in reply to Re^3: Need help with mysql dump script
in thread Need help with mysql dump script
What toolic (probably) meant was the "example under "die"" mentioned in the docu of chdir. If you do "perldoc -f die" you will see these two examples:
die "Can't cd to spool: $!\n" unless chdir '/usr/spool/news'; chdir '/usr/spool/news' or die "Can't cd to spool: $!\n"
The two lines are equivalent (to each other and to the line toolic posted) and show how to use chdir, specifically the use of $! to print the error message that the operating system returned.
The error message will tell you why it couldn't chdir. But to further explore the situation add
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');
|
|---|