use strict; use warnings; use Test::More tests => 1; my @dir_files = ('audit', 'notanaudit'); my @want = ('audit'); @dir_files = grep { /^audit/ } @dir_files; is_deeply \@dir_files, \@want;