Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^6: Simple inheritance question

by chromatic (Archbishop)
on Apr 23, 2010 at 19:36 UTC ( #836592=note: print w/replies, xml ) Need Help??


in reply to Re^5: Simple inheritance question
in thread Simple inheritance question

I didn't realize that Perl's package handling let's you "inherit" from a package that isn't actually a class.

There's no effective difference between a package and a class or a function and a method inside Perl 5. The internals don't care. If you treat something like a class name (by using it as an invocant), Perl 5 will use that package's namespace to find the destination method. Any reference blessed into a package will use that package's namespace to find its destination methods.

Those packages don't even have to exist for Perl 5 to attempt to dispatch to them as invocants, but you will get dispatch errors if they don't.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://836592]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2018-07-22 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (451 votes). Check out past polls.

    Notices?