Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Sharing and over-riding package functions

by rir (Vicar)
on Dec 12, 2008 at 16:55 UTC ( [id://729977]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Sharing and over-riding package functions
in thread Sharing and over-riding package functions

SUPER is a poor choice for a namespace because Perl defines SUPER to indicate a special pseudo-class. Your use of SUPER does coexist as a regular class of the same name. Confusing.

See perldoc perlobj.

Be well,
rir

Replies are listed 'Best First'.
Re^4: Sharing and over-riding package functions
by ruzam (Curate) on Dec 12, 2008 at 22:42 UTC

    SUPER is an excellent choice for a namespace (in this situation). It implies the same intention as Perl's built in pseudo-class, which is why I chose it. I get exactly what I expect by calling SUPER::myfunc(). Just as I get exactly what I expect by calling a blessed object with $obj->SUPER::myfunc().

    There would only be confusion if I were trying to mix a SUPER name space and blessed objects at the same time. If I had the option (or desire) to use blessed objects in this situation, I wouldn't need to mess with function references and namespaces :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found