Hi,
I am using a command as below in my script to change the directory. If the $dir is not available, the program dies.
I want to add some more functionality. For example, I want to send a mail before it dies. How do I do it? I know how to send e-mail but want to know how the existing code canbe changed in order to handle? Before
or die in the code? Thanks.
-
chdir($dir) or die "Can't chdir to $dir ! \n";