&scandir("c:/mydocu~1"); sub scandir { my $workdir = shift; # "c:/mydocu~1" is in $workdir chdir($workdir) || ... # chdir("c:/mydocu~1").. why not?