我需要在Perl脚本中构造一个文件路径.我应该使用哪个路径分隔符来允许我的脚本在Windows和Unix上运行?
请记住,Windows需要驱动器号.
bri*_*foy 12
你想要File :: Spec的catpath:
catpath()
Takes volume, directory and file portions and returns an entire path.
Under Unix, $volume is ignored, and directory and file are
concatenated. A '/' is inserted if need be. On other OSes, $volume
is significant.
$full_path = File::Spec->catpath( $volume, $directory, $file );
| 归档时间: |
|
| 查看次数: |
9201 次 |
| 最近记录: |