Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2016-12-04 03:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (61 votes). Check out past polls.