Change 23533 by [EMAIL PROTECTED] on 2004/11/24 16:07:38

        Subject: [patch pod/perlipc] use POSIX; w/o () is a bad idea
        From: Stas Bekman <[EMAIL PROTECTED]>
        Date: Wed, 24 Nov 2004 11:25:14 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/pod/perlipc.pod#57 edit

Differences ...

==== //depot/perl/pod/perlipc.pod#57 (text) ====
Index: perl/pod/perlipc.pod
--- perl/pod/perlipc.pod#56~23496~      Fri Nov 12 12:47:19 2004
+++ perl/pod/perlipc.pod        Wed Nov 24 08:07:38 2004
@@ -355,11 +355,16 @@
 you can try using the POSIX sigaction() function, which bypasses the
 Perl safe signals (note that this means subjecting yourself to
 possible memory corruption, as described above).  Instead of setting
-C<$SIG{ALRM}> try something like the following:
+C<$SIG{ALRM}>:
 
-    use POSIX;
-    sigaction SIGALRM, new POSIX::SigAction sub { die "alarm\n" }
-        or die "Error setting SIGALRM handler: $!\n";
+   local $SIG{ALRM} = sub { die "alarm" };
+
+try something like the following:
+
+    use POSIX qw(SIGALRM);
+    POSIX::sigaction(SIGALRM,
+                     POSIX::SigAction->new(sub { die "alarm" }))
+          or die "Error setting SIGALRM handler: $!\n";
 
 =item Restartable system calls
 
End of Patch.

Reply via email to