Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

Fun bug

Here's a fun bug. See if you can find what's happening:
my @data = function();
my @sorted = sort { $a->method <=> $b->method } @data;

foreach my $item (@sorted) {

The error message I was getting:

Can't call method "other_method" on undefined value at line ...

The question to you is: how is that possible?

I think you'll smile if/when you realize the answer.
Tags: perl, tech

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.