in reply to grep from file
outfile will containuse strict; open (INFILE, "<infile") or die "could not open file"; my %files; while (<INFILE>) { foreach ( /(\w+\.cxx)\b/g ) { $files{$_}++; } } close INFILE; open (OUTFILE, ">outfile") or die "could not open file"; foreach (sort keys %files) { print OUTFILE "$_\n"; } close OUTFILE;
Note that the order is not the same. This is due to the fact that I use a hash and the keys function does not give the keys back in any particular order, so I sort them. If you want to do the build-ing in perl then you can do something like thisaclpi.cxx i95val.cxx radiomeasurements.cxx rlpval.cxx
foreach (sort keys %files) { system "build", $_; }
--
flounder
|
|---|