another reason why you should always use warnings

Qiang on 2006-01-20T21:16:28

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!!