in reply to getting output from backticks

To expound further on the virtues of "system" check out Programming Perl for documentation of the system function. There is a code snippet for interpreting various possibilities including signals and coredumps on a UNIX system. I used the snippet and made a subroutine called sysub:
function sysub { my $cmd = shift; my $rc = 0xffff & system $cmd; if ($rc == 0xffff) { print "command failed: $!\n"; } elsif ($rc > 0x80) { $rc >>= 8; print "ran with nonzero exit status $rc\n"; } elsif ($rc != 0) { print "ran with "; if ($rc & 0x80) { $rc &= ~0x80; print "coredump from "; } print "signal $rc\n"; } return ($rc != 0); }
a sample invocation:
&sysub ("cp $source $target");
Unfortunately, I never researched the reasoning behind all the bit-twiddling but it has served me well for several years. I would appreciate enlightenment from more advanced monks on this aspect of the code. Also, any suggestions or improvements would be welcomed.