sub scandir { my ($workdir) = shift; chdir($workdir) || print "Unable to change to $workdir: $!\n";