Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Perlscript
➜ Directory fonctions
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Netzayanki
(2 posts) Bio
|
Date
| Mon 04 Jul 2005 11:02 AM (UTC) |
Message
| 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 | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #1 on Tue 05 Jul 2005 05:54 PM (UTC) |
Message
| 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. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #2 on Tue 05 Jul 2005 06:20 PM (UTC) |
Message
| 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. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,721 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top