# Perl 5 do{print "$_\n" if /pattern/} for @arr;