在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
http://stackoverflow.com/questions/5703705/print-current-directory-using-perl?rq=1
1) The following get the script's directory, which is not the same as the current directory. It's not clear which one you want.
or
or
The middle one handles symlinks different than the other two, I believe.
2) To get the current working directory (pwd on many systems), you could use cwd() instead of abs_path:
Or abs_path without an argument:
See the Cwd docs for details. To get the directory your perl file is in from outside of the directory:
See the File::Basename docs for more details.
3) You could use
完! |
请发表评论