in reply to Re: Inheritable pragma ... or how I learnt perls' compilation order
in thread Inheritable pragma ... or how I learnt perls' compilation order
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)...
Note that this is not too much more than thinking aloud i.e. code untried and untested ... yet;-)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/; } } }
Further Update
Corrected typo (missing trailing slash) in RE
|
---|