| Refresh | Home EGTry.com

a portable way to construct the filename from its directory and basename


use File::Spec;

my $filename=File::Spec->catfile("dir1", "test.pl");
print "filename: $filename\n";



Output

filename: dir1\test.pl