use File::Spec; my $filepath = File::Spec->catfile( $dir, $filename );