Monks,
I'm checking the return code of symlink using the following code. But, it is not reporting any error if source link is not existing. Is there any better way of handling this?
use strict; my ($link1, $link2); # source $link1 = '/var/tmp/sample.txt; #destination $link2 = '/tmp/sample.txt'; my $stat = symlink("$link1", "$link2"); if ( $stat ) { print "Link got created \n"; } else { print "Link not created \n"; }
In reply to error handling using symlink by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |