in reply to Re: Where is the @ISA array?
in thread Where is the @ISA array?

@__PACKAGE__::ISA means @ISA in the package "__PACKAGE__", not the current package.
oh, so only with __PACKAGE__-> do I get the current package placed there?

Replies are listed 'Best First'.
Re^3: Where is the @ISA array?
by ikegami (Patriarch) on Jan 21, 2009 at 15:53 UTC

    No, my post shows it being used elsewhere. And here's another:

    $ perl -le'print __PACKAGE__' main

    You wouldn't expect @time::ISA to mean @1232553153::ISA. Same goes for __PACKAGE__. It's a built-in function like time.

    $ perl -le'print CORE::__PACKAGE__' main

    Update: I can override it

    $ perl -wle'BEGIN { *CORE::GLOBAL::__PACKAGE__ = sub () { "abc" }; } p +rint __PACKAGE__' abc

    but I can't call prototype on it

    $ perl -wle'print prototype "CORE::__PACKAGE__"' Can't find an opnumber for "__PACKAGE__" at -e line 1.

    so it's not quite the same as other built-ins. That's probably the only difference.