Parser rejects indirect import call with slash argument (WWW::URLToys 1.28)

Open
#2,139 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, perl
Domain
compilers

Research direction

This is a grammar-level bug in PerlOnJava's statement parser, not in WWW::URLToys. Start by locating the grammar source (the .y/parser file that handles indirect method calls such as import Term::ReadLine /new/;) and the generated parser it feeds. Reduce the failing module to a one-line test script containing just require Term::ReadLine; import Term::ReadLine /new/; and run it through ./jperl to reproduce. Done means that snippet parses and dispatches to Term::ReadLine->import(/new/) like standard Perl, with a regression test added.

Written by the indexing model from the issue text.

Description

area:cpan-port area:parser bug

Module

  • Distribution: WWW-URLToys 1.28
  • CPAN tester report: syntax error, 2026-11-13
  • System Perl: /usr/bin/perl 5.34.1 on macOS arm64; perl Makefile.PL && make test passes (the distribution's test only loads the module and prints its version).
  • PerlOnJava: timeout 120 ./jperl -Iblib/lib -Iblib/arch test.pl fails while loading the module:
    syntax error at blib/lib/WWW/URLToys.pm line 240, near "Term::ReadLine "

Reproducer and cause

At line 240, the module has this valid legacy indirect method call:

import Term::ReadLine /new/;

It follows require Term::ReadLine; and invokes import with the regex /new/ as an argument. Standard Perl accepts and executes this syntax. PerlOnJava reports a syntax error at the package name, showing that its statement parser does not accept the indirect method-call form with a slash-delimited argument in this position. The error is in parsing this valid call, before Term::ReadLine behavior is used.

Expected

The statement compiles and calls Term::ReadLine->import(/new/), matching standard Perl.

Dominant language
Perl
Stars
67
Forks
8
Avg merge
5h 12m
Merged PRs (30d)
131

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fglock/PerlOnJava

All issues in fglock/PerlOnJava

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.