Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Qiang (5577)

Qiang
  (email not shown publicly)
http://www.goodspot.ca/

Journal of Qiang (5577)

Friday January 20, 2006
04:16 PM

another reason why you should always use warnings

[ #28421 ]
I was trying to figure out why this script not working..

#!/usr/bin/perl

while (<>){
  chomp;
  print;
  eval{
    local $SIG{ALARM} = sub{die "\n"};
    alarm 3;
    print " ",$1 if `bpcoverage -c $_`=~/(VERSION:.*)/;
    alarm 0;
  };
  alarm 0;
  next if $@;
}

after scratching my head for a while, I decided to add use warnings and strict then I got the complains that $SIG{ALARM} is unregistered signal. ARGH!! how stupid.. should have used $SIG{ALRM}

now I am going to start using strict and warnings no matter the lenght of the script!!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.