Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: __PACKAGE__ variable cannot use as replace of package name

by moritz (Cardinal)
on Apr 23, 2013 at 07:24 UTC ( #1030056=note: print w/ replies, xml ) Need Help??


in reply to __PACKAGE__ variable cannot use as replace of package name

Undefined subroutine &__PACAKGE__::bar called

First of all you misspelled PACKAGE, which is not a good thing to do.

But the real reason is that __PACKAGE__ is only handled specially when it's a term on it own, not when it's part of a name.

And finally __PACKAGE__ as a separate term becomes a string, and you can't write "MyPackage"::bar() either.


Comment on Re: __PACKAGE__ variable cannot use as replace of package name
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030056]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-09-18 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (108 votes), past polls