in reply to Re: Getting current directory
in thread Getting current directory
Yeah, I wouldn't normally use the backticks there, but it proves my point. Also, $0 is spoofable. Cwd is a more reliable solution.print $ENV{PWD}, "\n"; chdir('perl'); print $ENV{PWD}, "\n"; print `ls`;
Update: You can spoof $0 by using symlinks, at least if your OS supports them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Getting current directory
by tye (Sage) on Feb 09, 2001 at 23:37 UTC |