http://www.perlmonks.org?node_id=1029390

PerlSufi has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks, Here is my code. I have a list of lines with comma separated data. Eventually I need them in an Excel file- but first I need all the ones containing only AZ.
my $match = "AZ"; my $content = $mech->content; my @lines = split /^/, $content; my @keepers = grep { $match } @lines; foreach my $line (@keepers){ print $line; }