Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Inheritable pragma ... or how I learnt perls' compilation order

by Bloodnok (Vicar)
on Aug 06, 2008 at 10:01 UTC ( [id://702592]=note: print w/replies, xml ) Need Help??


in reply to Re: Inheritable pragma ... or how I learnt perls' compilation order
in thread Inheritable pragma ... or how I learnt perls' compilation order

Hi ,

Thanx for your insight - looks like UNITCHECK or, probably, CHECK would be the way to go.

Way to go kyle :-))

Update

Thinking about it, using the CHECK block would be best as it's also run when using perl -c .... Something like the following would possibly suffice (based on code supplied elsewhere in the thread 702588)...

CHECK { my $dp = B::Deparse->new(); while (my ($pkg, $hash) = each %INTERFACES) { while (my ($var, $glob) = each %{"${pkg}::"}) { next unless defined &$glob; croak "Constructor detected: ${pkg}::$var" if $dp->coderef2text(\&{"${pkg}::$var"}) =~ /\bbless\b/; } } }
Note that this is not too much more than thinking aloud i.e. code untried and untested ... yet;-)

Further Update

Corrected typo (missing trailing slash) in RE

At last, a user level that overstates my experience :-))

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-24 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found