Perl Programming/Keywords/chdir

The chdir keyword
chdir changeds the working directory to the new destination in EXPRESSION. Without EXPRESSION, it changes to the directory defined in $ENV{HOME}, if set. If this is also not set, it changes to $ENV{LOGDIR}. (On VMS, $ENV{SYS$LOGIN} is also checked.)

chdir returns <tt>true</tt> on success and <tt>false</tt> otherwise.

If the operating system supports <tt>fchdir(2)</tt>, a <tt>DIRHANDLE</tt> or <tt>FILEHANDLE</tt> can also be used. If this is not the case, an exception is raised.