Saturday, February 21, 2015

Perl 에서 파일 패스 concatenate 하는 법

use File::Spec;
하고
print File::Spec->catdir(dirname, filename);
하면 됨


use File::Spec;
print File::Spec->catdir('dir1/dir2/dir3', '../filename'),"\n";
print File::Spec->catdir('dir1/dir2/dir3', '../../filename', ),"\n";

키워드 : file path, filepath, merge, append
출처 : How to concatenate pathname and relative pathname?

No comments:

Post a Comment