in reply to Using File::Find

File::Find has the worst interface of all finding modules. I recommend Path::Iterator::Rule instead.
use Path::Iterator::Rule qw(); use Path::Tiny qw(path); my %files = map { $_ => path($_)->basename } Path::Iterator::Rule->new ->name(qr/hp[.]txt$/) # regex of file name ->all('.'); # starting in the current directory