die "Can't cd to spool: $!\n" unless chdir '/usr/spool/news'; chdir '/usr/spool/news' or die "Can't cd to spool: $!\n" #### use Cwd; #at the start of your script ... print "We are here: ",cwd(),"\n"; #test where you are in the directory structure #alternatively this works too, but is not as portable: print "We are here:"; system('pwd');