perlのsystem関数の戻り値
意外と探すの大変だったので情報めも
http://perldoc.perl.org/functions/system.html
if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; }
起動したシェルの戻り値と子コマンドの戻り値が8bitずつくっついて返ってくる、ってことかな。あれ、perldocに書いてあったのか・・・・