summaryrefslogtreecommitdiff
path: root/pod/perlipc.pod
diff options
context:
space:
mode:
authorStas Bekman <stas@stason.org>2004-11-24 06:25:14 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-11-24 16:07:38 +0000
commite399c6ae35b89e9cc7cbf04b75c6458d318a75d0 (patch)
treea77658c773df0a25cdbcbc500838a23121abb2a5 /pod/perlipc.pod
parenta537debe17982e491ffa12d12441cf74a452acb2 (diff)
downloadperl-e399c6ae35b89e9cc7cbf04b75c6458d318a75d0.tar.gz
[patch pod/perlipc] use POSIX; w/o () is a bad idea
Message-ID: <41A4B5EA.3020804@stason.org> p4raw-id: //depot/perl@23533
Diffstat (limited to 'pod/perlipc.pod')
-rw-r--r--pod/perlipc.pod13
1 files changed, 9 insertions, 4 deletions
diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index f94cc5b653..76dcfed734 100644
--- a/pod/perlipc.pod
+++ b/pod/perlipc.pod
@@ -355,11 +355,16 @@ with your timeouts. If you are having problems with such functions,
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