in reply to Re^3: Surprising behavior of Cwd module on Unix with symlinks
in thread Surprising behavior of Cwd module on Unix with symlinks

The portability problem with $ENV{PWD} is that it assumes Unix. `pwd` also assumes Unix. The OP said "though I could replace the Cwd::cwd() calls with `pwd` (for Unix only), I'd prefer a more portable solution."

In addition, $PWD isn't a bashism. csh and ksh also populate it.

  • Comment on Re^4: Surprising behavior of Cwd module on Unix with symlinks

Replies are listed 'Best First'.
Re^5: Surprising behavior of Cwd module on Unix with symlinks
by ikegami (Patriarch) on Feb 09, 2011 at 15:22 UTC

    The portability problem with $ENV{PWD} is that it assumes Unix. `pwd` also assumes Unix.

    You already mentioned that, and I already addressed that. It's still irrelevant and it's still wrong.

    It's irrelevant because my solution isn't "use $ENV{PWD}".

    It's wrong because the portability of $ENV{PWD} has nothing to do with unix (and even less to do with Unix). It's completely dependent on your shell. It won't work on all unix setups, and it will work on non-unix setups.

    In addition, $PWD isn't a bashism. csh and ksh also populate it.

    And does Cwd's chdir. Yes, I simplified. The point is that it's shell-specific.