You could use grep and s with a funky regex, but I think map would be simpler...
my @cxx = map { /(\w+\.cxx)@@/ ? ($1) : () } <FILE>;
Although, if all you're going to do with @cxx is print it out to a new file, you can avoid building a temporary array with something like...
print NEWFILE map { /(\w+\.cxx)@@/ ? ("$1\n") : () } <FILE>;
--k.
In reply to Re: grep from file
by Kanji
in thread grep from file
by Sara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |