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

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.
  • If there's a subroutine called Foo that returns an undefined value, you get that error message.
    sub Foo {}
    use Foo;
    my $foo = Foo -> new;

    __END__
    Can't call method "new" on an undefined value at...
    • Yup. I was called over to look at the problem and it simply didn't occur to me that someone would name a sub after a package name.

      • Despite the fact that you are the author of aliased [cpan.org]?

        • With aliased, the sub is not the package name -- it's a shorter version -- and in any event, because it has a null prototype, it gets inlined away and no subroutine is left in the symbol table.

          However, that's still a pretty lame defense on my part :)

          • the sub is not the package name – it’s a shorter version

            Yeah, but it’s used like a package name, on the left side of an arrow operator.

            it gets inlined away and no subroutine is left in the symbol table.

            Not at all. It gets inlined into calls, but the subroutine is always there.