PPI :: Document error or some special subroutine name?

I have some problems with the PPI module:

Suppose I have Foo.pm:

package Foo;

sub foo0 { 1; }
sub foo1 { 1; }
sub foo2 { 1; }
sub foo3 { 1; }

1;

and I want to use PPI to get all the submarines:

#!/usr/bin/env perl
use PPI;
my $filename = shift;
my $Document = PPI::Document->new($filename);
my $subs = $Document->find('PPI::Statement::Sub');
warn $#$subs;

as a result, I got a "3", which is correct.

but when one of my subsets in Foo.pm is called "sub vN ...", where N is a number, fe:

sub v1foo {}

or

sub v3bar {}

or simply

sub v2 {}

PPI :: Document search, apparently, interrupts parsing and returns only already found subs. Therefore, if I change Foo:

package Foo;

sub foo0 { 1; }
sub foo1 { 1; }
sub v2xx { 1; }
sub foo3 { 1; }

1;

The result of my test will be "1" (subsets foo0 and foo1 found)

Is the declaration of routines such as v [0..9] somehow forbidden?

Hey.

+5
source share
1 answer

This is an (unknown) error.

"v-numbers" " ".

v v1.2.3 PPI ​​:: Token:: Number:: Version.

, , - "v, digit,...", v-, ( ).

, sub v1 {} v1 "v1", v-number .

PPI https://rt.cpan.org/Public/Dist/Display.html?Name=PPI

+5

All Articles