in reply to Questions about Grep
If you want to grep a file in Perl, you can read it into an array first:
There's also the File::Grep module from CPAN which provides some easy-to-use file grepping functionality.use strict; open my $fh, "file.txt" or die "Error opening file.txt: $!"; my @lines = <$fh>; my @matches = grep /pattern/, @lines;
In Section
Seekers of Perl Wisdom