cartman94501 (cartman94501) wrote in perl,
cartman94501
cartman94501
perl

Am I going insane?

This code snippet (line numbers are obviously not part of the code):

137:print "right before the weirdness, url=\|$url\|\n";
138:if ($url =~ /(jpg|gif|png)/i) {
[do something utterly irrelevant here]
}

sometimes, but not always, causes the following output:

right before the weirdness, url=|http://bp.specificclick.net?pixid=99002077|
Use of uninitialized value in pattern match (m//) at [scriptname].pl line 138.

We see that $url is non-null, and obviously (jpg|gif|png) is a constant, so how could either side of the pattern match be uninitialized? The script appears to work, but it keeps throwing this error. Oddly, this only started this week ago, and until it happened, I had made no recent changes, either to the code or to Perl.

I lack the necessary hubris to think that I've discovered a bug in Perl, rather than in my humble code, but the mind does boggle.

I am running Perl 5.8.8.822 under Windows XP, SP2. There are 16 registered patches, none of which I installed manually, which I can provide if you think it's relevant.

Thanks in advance for your help!

  • Post a new comment

    Error

    default userpic
  • 15 comments