in reply to Platform independant PWD

Well you can use `cd` in Win32, but unless you want to install a pwd binary on Win32 I can't think of a real platform independent way to do it.

Update: D'oh! Ok, I forgot about cwd(), but to justify this update I'll just note that `cd` and cwd() give you different directory slashes, which might matter depending on what you wanted to do with the results.

Replies are listed 'Best First'.
Re: Re: Platform independant PWD
by tenatious (Beadle) on Nov 16, 2000 at 22:09 UTC
    although, you could write a little trap for OS.... I don't use win32, so I don't know the value of $^O on win32, but you could do something like this:
    if ($^O =~ /linux/) { $working_directory = `pwd`; } elsif ($^O =~ /win32/) { # or value for win32 $working_directory = `cd`; } else { $working_directory = "./"; # :) }