=head1 NAME Faster - do some things faster =head1 SYNOPSIS use Faster; =head1 DESCRIPTION =over 4 =cut package Faster; use strict; BEGIN { our $VERSION = '0.01'; require XSLoader; XSLoader::load __PACKAGE__, $VERSION; } use B (); our $source; our $label_next; our $label_last; our $label_redo; sub entersub { my ($cv) = @_; my %opsseen; my @ops; my @todo = $cv->START; while (my $op = shift @todo) { for (; $$op; $op = $op->next) { last if $opsseen{$$op}++; push @ops, $op; my $name = $op->name; if (B::class($op) eq "LOGOP") { push @todo, $op->other; } elsif ($name eq "subst" and ${ $op->pmreplstart }) { push @todo, $op->pmreplstart; } elsif ($name =~ /^enter(loop|iter)$/) { # if ($] > 5.009) { # $labels{${$op->nextop}} = "NEXT"; # $labels{${$op->lastop}} = "LAST"; # $labels{${$op->redoop}} = "REDO"; # } else { # $labels{$op->nextop->seq} = "NEXT"; # $labels{$op->lastop->seq} = "LAST"; # $labels{$op->redoop->seq} = "REDO"; # } } } } for (@ops) { printf "%s\n", $_->name; } # walklines(\@lines, 0); } hook_entersub; 1; =back =head1 AUTHOR Marc Lehmann http://home.schmorp.de/ =cut