you can try Cwd
perl -e 'use Cwd 'abs_path'; print abs_path("myfile");'
Frage
I open a directory a/b/c/
c
has d1 , d2, d3 d4
I wanna print the path of d1 d2 d3 d4
like
a/b/c/d1
a/b/c/d2
a/b/c/d3 and soo on
Lösung 2
you can try Cwd
perl -e 'use Cwd 'abs_path'; print abs_path("myfile");'
Andere Tipps
use Cwd 'abs_path';
print "$_\n" for map abs_path($_), glob("a/b/c/*");
Unless you want to canonize the path for prettyness (in which case you want File::Spec->canonpath
and not Cwd::abs_path
), you can simply use
"$dir/$fn"