use File::Spec (); my $full_file = ( File::Spec->canonpath( File::Spec->catfile($dir, $file) ) );