Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 romping around the Monastery: (12)
As of 2015-07-28 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (257 votes), past polls