Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    };
    print "$@"  if $@;
    print "$elapsed\n";
    
  2. or download this
    5.006
    alarm-timeout signal at /home/jbho/bin/test_SIGALRM.pl line 15.
    Died at /home/jbho/bin/test_SIGALRM.pl line 16.
    0.999504
    
  3. or download this
    5.008
    alarm-timeout signal at /home/jbho/bin/test_SIGALRM.pl line 15.
    Died at /home/jbho/bin/test_SIGALRM.pl line 16.
    109.948451
    
  4. or download this
    use POSIX ':signal_h';
    my $alarm = 0;
    sigaction SIGALRM, new POSIX::SigAction sub { $alarm = 1 }
        or die "Error setting SIGALRM handler: $!\n";