This function changes the working directory.
chdir EXPR; # # remember the current directory # my $dirOld = $ENV{PWD}; # # the following lines are equivalent # chdir "/home/user/"; chdir( $ENV{ "HOME"} || $ENV{ "LOGDIR"}); chdir (); chdir (getpwuid( $<)[7]);