开发者

How do i find the directory of a file in perl?

开发者 https://www.devze.com 2023-03-03 02:14 出处:网络
I am using the directory structure which looks like :- proto08/qa08/short/drc/cases/hello/win I am running a perl file which is stored in \"short\" dir.

I am using the directory structure which looks like :- proto08/qa08/short/drc/cases/hello/win

I am running a perl file which is stored in "short" dir. The perl line is parsing a file which is on "win" dir. The file which is being parsed uses a line :-开发者_JAVA技巧 source ../../master.txt.

I found the file name using a regex which is "../../master.txt" and i want to parse "../../master.txt" also.

How can i do this? Any suggestions?


I think you want dirname

If you want realpath behaviour as well, look at the Cwd core module

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号