开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜