- or download this
# Reading from a prepopulated array
my @wanted;
foreach my $line ( @input ) {
push $line, @wanted if $line =~ /^SELECT poid/;
}
- or download this
# Reading from a filehandle
my @wanted;
foreach my $line ( <$input_fh> ) {
push $line, @wanted if $line =~ /^SELECT poid/;
}
- or download this
my @wanted = grep { /^SELECT poid/ }, @input;