exit($?) is never correct, since ($? >> 8) is needed to extract
the correct exit code, as other information (e.g. such as signal)
is encoded in $? in addition to the exit code.
chomp(my $op = <STDIN> || '');
$op = lc($op);
goto retry_edit if $op eq 'r';
- exit $? if $op eq 'q';
+ if ($op eq 'q') {
+ # n.b. we'll lose the exit signal, here,
+ # oh well; "q" is user-specified anyways.
+ exit($? >> 8);
+ }
last if $op eq 'c'; # continuing
print STDERR "\`$op' not recognized\n";
}