18 like($@, qr/^Horribly/, 'die with no args propagates $@');
19 like($@, qr/\.{3}propagated at/, '... and appends a phrase');
22 local $SIG{__DIE__} = sub { is( $_[0], "[\000]\n", 'Embedded null passed to signal handler' )};
28 is( $@, $err, 'Embedded null passed back into $@' );
32 local $SIG{__DIE__} = sub {
33 isa_ok( $_[0], 'ARRAY', 'pass an array ref as an argument' );
39 is( $x->[0], 4, 'actual array, not a copy, passed to signal handler' );
48 is($@->[0], 7, 'die with no arguments propagates $@, but leaves references alone');
52 die bless [ 7 ], "Error";
54 isa_ok( $@, 'Error', '$@ is an Error object' );
58 isa_ok( $@, 'Out', 'returning a different object than what was passed in, via PROPAGATE' );
59 is($@->[0], 9, 'reference returned correctly');
66 bless [$_[0]->[0]], "Out";
75 my $msg = "ce ºtii tu, bã ?\n";
77 is( $@, $msg, "Literal passed to die" );
79 local $SIG{__WARN__} = $SIG{__DIE__} = sub { $err = shift };
81 is( $err, $msg, 'die handler with utf8' );
83 is( $err, $msg, 'warn handler with utf8' );
84 eval qq/ use strict; \$\x{3b1} /;
85 like( $@, qr/Global symbol "\$\x{3b1}"/, 'utf8 symbol names show up in $@' );
88 # [perl #36470] got uninit warning if $@ was undef
91 use warnings "uninitialized";
94 local $SIG{__WARN__} = sub { $ok = 0 };
95 eval { undef $@; die };
96 is( $ok, 1, 'no warnings if $@ is undef' );
98 eval { $@ = 100; die };
99 like($@."", qr/100\t\.{3}propagated at/,
100 'check non-PVs in $@ are propagated');
104 local $TODO = 'RT #4821: die qr{x} does not check termination';
105 my $out = runperl(prog => 'die qr{x}', stderr => 1);
106 like($out, qr/at -e line 1./, 'RT #4821: output from die qr{x}');