http://qs321.pair.com?node_id=11114068

cavac has asked for the wisdom of the Perl Monks concerning the following question:

I have an application that uses literally hundreds of modules (plus in turn their dependencies). And it's a forking application, specifically a webserver.

My problem is that sometimes a child will hang with 100% CPU usage during the DESTROY call. What would be the best way to debug this?

Print statements? Setting hundreds of debug points?

Is there any good way to overload DESTROY without loosing the original functions? EDIT: To clarify, automatically adding a print "starting DESTROY in $filename"/"Ending destroy in $filename" to every DESTROY function would help quite a lot.

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'