my @filtered; for $str (@original) { if ($str ~~ /someregex/) { push @filtered, $str; } }