I'd like to get the start and end ranges of subroutines in a file much the same way that Perl does for the %DB:sub hash when debugging is turned on.
I can approximate this using B:Utils::all_starts by looking for minimum and maximum COP lines, but that really isn't the same thing since the first executable line might not be on the same line as the sub declaration. For example:
sub five {
5;
}
sub six { 6; }
Note that the start and end lines of five() are one less and one greater than the single returned expression, 5; For six() though everything is on the same line.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |