Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Alias for object namespace

by broquaint (Abbot)
on Jan 29, 2005 at 01:34 UTC ( #426166=note: print w/ replies, xml ) Need Help??


in reply to Alias for object namespace

To achieve such aliasing in code simply qualify the package name with a trailing :: e.g

{ package foo; sub meth { printf "I was declared in %s, but called with %s\n", __PACKAGE__, $_[0]; } } *bar:: = *foo::; bar->meth; __output__ I was declared in foo, but called with bar
HTH

_________
broquaint


Comment on Re: Alias for object namespace
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-11-26 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (173 votes), past polls