-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stas Bekman writes:
> Justin Mason wrote:
> [...]
> > sub trap_sigalrm {
> >   my ($handler) = @_;
> > 
> >   if ($^V lt v5.8.0) {
> 
> I'd rather use something that will always work:
> 
>       $] < 5.008
> 
> I'm not sure v-objects work everywhere (I could be wrong).

You're right.  problems with 5.005.

> >     print "using SIG\n";
> >     $SIG{ALRM} = $handler;
> >   } else {
> >     print "using sigaction\n";
> >     use POSIX qw();
> 
> that should be:
> 
>        require POSIX;
> 
> use() is always executed, ragardless where you put it. perldoc -f use.

sure -- not a problem for me, since "use POSIX" at least doesn't
cause errors or warnings on any perl since 5.005 ;)  but good point.

> >     POSIX::sigaction POSIX::SIGALRM(), new POSIX::SigAction $handler;
> 
> Also I have to note that under Apache2 (if you plan to run this code under 
> modperl2) most signals are not available, due to thread-safety and other 
> issues. So only the POSIX alarm code works (i.e. requires 5.8.x+) and only 
> with prefork mpm.
> http://perl.apache.org/docs/2.0/user/coding/coding.html#Using_Signal_Handlers

interesting -- not an issue for me but worth noting. cheers,

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFBt4FOMJF5cimLx9ARAjv5AJ9OwKV+QTLwtUFxrhw6ARDgdmDLxACgqMeN
wptNtf7jSbsWLglcqEuGObM=
=mKDv
-----END PGP SIGNATURE-----

Reply via email to