This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: store method value in variable
[perl5.git] / lib / sigtrap.t
index 0469a9a..8ee0696 100644 (file)
@@ -59,8 +59,10 @@ is( $SIG{FAKE}, 'IGNORE', 'respect existing handler set to IGNORE' );
 
 fresh_perl_like
   '
-    use sigtrap "INT";
-    sub { kill "INT", $$ } -> (3)
+    BEGIN { *CORE::GLOBAL::kill = sub {} }
+    require sigtrap;
+    import sigtrap "INT";
+    sub { $SIG{INT}->("INT") } -> (3)
   ',
    qr/\$ = main::__ANON__\(3\) called/,
   { stderr => 1 },