Directory fonctions

Posted by Netzayanki on Mon 04 Jul 2005 11:02 AM — 3 posts, 17,751 views.

#0
Does anybody know how to find the current directory in Perl? 5.8.2 for Windows?

I would like to know if there is a function like "pwd" in linux...

Thank you
USA #1
You shouldn't post a message twice if you don't get a response the first time. It's possible that people simply don't know. I checked the perl docs and couldn't see anything offhand that looked like it would do it.
USA #2
A quick google turned up this:
http://www.unix.org.ua/orelly/perl/learn32/ch12_01.htm

Basically, spawn a shell command, or use Win32::getcwd (and theres about 10 different other commands, all with their own quirks).

However, there are also things to look out with with perl and directories. If you spawn a shell command to change a directory, it probably wont change the directory of the perl program. And you have a couple of paths to begin with anyway. Just be careful working with directories.

Oh, and this forum is for perlscript in mushclient, this question should probably be in programming > general, if anywhere.