- or download this
use strict;
use File::Spec::Functions;
...
my @dirs = qw( ../dir/path1 ../dir/path2 );
my @canon_dirs = map { canonpath($_) } @dirs;
print Dumper(\@canon_dirs);
- or download this
../somedir/path
$VAR1 = [
'../dir/path1',
'../dir/path2'
];
- or download this
..\somedir\path
$VAR1 = [
'..\\dir\\path1',
'..\\dir\\path2'
];
- or download this
use strict;
use File::Spec::Functions;
...
print "$file1\n";
my $file2 = canonpath("$ROOTDIR/../input/data2.txt");
print "$file2\n";
- or download this
C:\Data\data.txt
C:\Data\..\input\data2.txt
- or download this
/var/data/data.txt
/var/data/../input/data2.txt