Hi all,
I am writing a subrouting in perl where I am using chdir to change the directory to a mapped drive/directory. If it successfully changes the drive, then it proceeds further. However, if the chdir fails (it means the drive is not mapped) then the script maps the drive (with net use).
Oh! By the way, I don't want to use 'Die'. Please let me know how to evaluate if the last statement is successful.
This is driving me crazy. Any help would be really appreciated.
Here's my sample code:
sub map_check();
{
chdir($map_drive);
if chdir is successful (means the drive is mapped)
{
<do something>
}
else
{
`net use s: \\\\server\shared`;
copy_files();
}
}
I am writing a subrouting in perl where I am using chdir to change the directory to a mapped drive/directory. If it successfully changes the drive, then it proceeds further. However, if the chdir fails (it means the drive is not mapped) then the script maps the drive (with net use).
Oh! By the way, I don't want to use 'Die'. Please let me know how to evaluate if the last statement is successful.
This is driving me crazy. Any help would be really appreciated.
Here's my sample code:
sub map_check();
{
chdir($map_drive);
if chdir is successful (means the drive is mapped)
{
<do something>
}
else
{
`net use s: \\\\server\shared`;
copy_files();
}
}