We can define our own system call that will throw an error (die) on failure.
Quick example:
sub my_system { system($_[0]) || die "$_[0] failed : $!"; } eval { my_system( "cp xyz.dat abc.dat" ); my_system("cp xyz.dat2 abc.dat2"); } if ($@) { print "Error occured : $@\n" }
In reply to Re: Perl exception - multiple statement
by spazm
in thread Perl exception - multiple statement
by pradeepbstays
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |