| [reply] |
I've tested both cwd() and getcwd() before, and looked at the source. They both resolve symlinks. And the pwd and PWD variable from bash are not the same.
UPDATE:Okay, so when we type pwd in bash by default we get the shell builtin, not the external Unix utility (/bin/pwd on my system). And the shell's pwd defaults to -L (logical) and we get the bash PWD. The external Unix utility defaults to -P (physical) which resolves symlinks. And if we run /bin/pwd -L, it still retrieves from PWD environment variable. Confirming my original question, we do need PWD and there's no way in Perl we can get the same version without PWD.
| [reply] |