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