my $dirname= '/some/directory/with/files'; my $input= '2013-09-04'; opendir my $dh, $dirname or die "Couldn't read '$dirname': $!"; my @found= grep /^\Q$input\E/, readdir $dh; ...