print "$_\n" for grep /pattern/, @arr;