Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:44:58+00:00 2026-05-28T18:44:58+00:00

i have some problems with PPI module: assume i have Foo.pm: package Foo; sub

  • 0

i have some problems with PPI module:

assume 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 subs:

#!/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 result i got ‘3’ which is correct.

but when one of my subs in Foo.pm is called ‘sub vN…’, where N is a number, f.e.:

sub v1foo {}

or

sub v3bar {}

or simply

sub v2 {}

PPI::Document find seems to break parsing and returns only the already found subs.
So if i modify Foo:

package Foo;

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

1;

Result of my test would be “1” (found subs are foo0 and foo1)

Is declaring subroutines names like v[0..9] somehow forbidden?

Greetings.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:44:59+00:00Added an answer on May 28, 2026 at 6:44 pm

    This is a (unknown) bug.

    It is related to the concept of “v-numbers” or “version numbers”.

    A v number looks something like v1.2.3 and parsers into an PPI::Token::Number::Version object.

    The problem you are seeing is the parses spotting “v, digit, …”, parsing it as a v-number and then starting the next token at the character after it (which it shouldn’t do).

    Additionally, in the sub v1 { } case the v1 should be parsed as the subroutine name “v1” instead of a v-number anyway.

    You should report this PPI bug tracker at https://rt.cpan.org/Public/Dist/Display.html?Name=PPI

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to use .animate function but i have some problems i want to
I have some problems with authorization. I don't want to use Spring Security, just
I have some problems with Extjs4 librairie. I want to use treeEditor component. Firebug
I am just starting Java RMI and have some problems with when to use
I have some problems with ASP.NET page cycle. I want to fire event when
I have some problems with PHP Rename . $rm = rename($path.$package./,$path.$get[theme_name]./); if ($rm ==
I have some problems defining a module. Here's a short reduction of the code:
I have some problems with OnTouchListener . I want that everytime when user touch
I have some problems with some customers, in my application I use Simple MAPI
I have some problems with my htaccess... I want to have my url's like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.