#!./perl
#
# Verify that C<die> return the return code
# -- Robin Barker <rmb@cise.npl.co.uk>
#
BEGIN {
chdir 't' if -d 't';
}
exit 0;
}
$| = 1;
use strict;
my %tests = (
1 => [ 0, 0],
2 => [ 0, 1],
3 => [ 0, 127],
4 => [ 0, 128],
5 => [ 0, 255],
6 => [ 0, 256],
7 => [ 0, 512],
8 => [ 1, 0],
9 => [ 1, 1],
10 => [ 1, 256],
11 => [ 128, 0],
12 => [ 128, 1],
13 => [ 128, 256],
14 => [ 255, 0],
15 => [ 255, 1],
16 => [ 255, 256],
# see if implicit close preserves $?
17 => [ 0, 512, '{ local *F; open F, q[TEST]; close F; $!=0 } die;'],
);
print "1..$max\n";
# Dump any error messages from the dying processes off to a temp file.
}
else {
}
my $exit = $?;
# VMS exit code 44 (SS$_ABORT) is returned if a program dies. We only get
# the severity bits, which boils down to 4. See L<perlvms/$?>.
}