Perl really needs more tools to support software engineering. First and foremost among those is allowing metrics to be gathered. (Yes, there are bad metrics and there are metrics that can be easily weaseled, but I'm not telling you which metrics to use!) Obviously parsing the raw perl isn't going to be easy enough in perl5. But once perl parses it couldn't we navigate the op tree? That should make it easy to see how many non-local variables are affected and what-not.
If somebody has enough free time to put something into a project like this, let me know. Particularly if you're familiar with the way the B:: modules work.