質問

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
役に立ちましたか?

解決 2

you can try Cwd

perl -e 'use Cwd 'abs_path'; print abs_path("myfile");'

他のヒント

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"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top