use strict; my $path = shift || $ENV{HOME}; print "will cd to '$path'\n"; # these both won't work (obviously ;-) #$ENV{PWD}=$path; #chdir($path); # changes this process' directory.