develooper Front page | perl.perl5.porters | Postings from January 2012

Tying special variables considered horrible and useful

Thread Previous | Thread Next
Steffen Mueller
January 18, 2012 14:34
Tying special variables considered horrible and useful
Message ID:
On 01/18/2012 11:04 PM, Father Chrysostomos via RT wrote:
> On Wed Jan 18 12:53:06 2012, rcaputo wrote:
>> Interoperability requires cooperation from the author, and he's been
>> known to break it for modules he doesn't like.  Ask Paul Evans and/or
>> Matt Trout about this:
>> 6.13/lib/
> Tying %INC could solve that. :-)

Other fun aside: Tying special variables can actual be very useful. I 
was surprised to learn that tying %SIG works just fine. It's very useful 
for cases of "huge codebase" and "where are my warnings going" or 
similar problems. IOW Devel::TrackSIG will tie %SIG (if loaded early) 
and tell you where the current value of $SIG{$whatever} comes from for 
debugging at any place where you otherwise expect an exception out warning.

Doesn't matter up to a ~ 10k line code base, I guess, but at some point, 
it can get pretty hairy to figure this out manually.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About