in reply to Breaking up a text file to make a Makefile
Try this for a start?
#!/usr/bin/perl use strict; use warnings; use v5.10; open my $FILE ,"makefile.txt"; my $accum=""; while(<$FILE>){ chomp; if(s%(.*?)\\$% %){ $accum.=$1; } else { $accum.=$_; $accum=~s/\s+/ /gs; say $accum; $accum=""; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Breaking up a text file to make a Makefile
by flybd5 (Initiate) on Mar 13, 2015 at 13:12 UTC |