Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Package level scope callbacks.

by fergal (Chaplain)
on Jul 31, 2004 at 17:28 UTC ( #378953=note: print w/replies, xml ) Need Help??


in reply to Package level scope callbacks.

The only thing I can think of (and it's not pretty) is to do something like
BEGIN{ %SomePackage::copy:: = %SomePackage::; %SomePackage:: = (); # actually, you should probably only move the subs # and leave the variables etc where they are. } package SomePackage; sub AUTOLOAD { # in here check caller() to see if you're crossing # package boundaries and then call the pre-function # wrappers and then call the real function, paying # attention to wantarry etc then call the post-function # then return the data }
slow, ugly, complicated but it should do what you want.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2021-05-14 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (148 votes). Check out past polls.

    Notices?