in reply to Re^3: Question regarding handling exceptions in subroutine
in thread Question regarding handling exceptions in subroutine
Shouldn't it be something like this?
Update:
OK, eval...
my $result; eval { $result = qx($command); }; if ( $? >> 8 != 0 ) { if ($@) { die $@; } else { die qq(Something really weird happened!); } } # do stuff with $result...
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Question regarding handling exceptions in subroutine
by space_monk (Chaplain) on May 13, 2013 at 10:28 UTC | |
by karlgoethebier (Abbot) on May 13, 2013 at 12:31 UTC |