... use Path::Tiny; ... sub check_file{ -f && push ... , path($File::Find::name)->canonpath}); }