The Cwd module provides three functions that get the pathname of the current working directory. Using these functions instead of the pwd command will make your code more portable, because not all systems have pwd.
Gets the current working directory. This is the safest way to get it.
A faster way to get the directory, but somewhat more dangerous because of the way it works internally.
Does the same thing as cwd by reimplementing the C library functions getcwd(3) or getwd(3) in Perl.
Copyright © 2002 O'Reilly & Associates. All rights reserved.