Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Imported Language::Functional break subroutine is parsed as an operator

Open
#1,430 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java, perl
Domain
backend, compilers

Research direction

Start with the upstream reproduction in t/simple.t at line 77 and the focused project regression that reproduces it on both backends. Trace how imported subroutines are resolved when their names overlap with operators, then run the JVM and interpreter tests. Done means break { ... } $list parses and executes on both backends, genuine operators still work, and the upstream 97-test suite passes.

Written by the indexing model from the issue text.

Description

area:cpan-port area:parser bug

Summary

Language::Functional 0.05 fails under PerlOnJava because its exported break function is parsed as a built-in operator instead of being resolved as the imported Perl subroutine.

Reproduction

The upstream test t/simple.t imports all functions from Language::Functional and calls:

use Language::Functional ':all';

ok(eval {show(break { shift() >= 4 } [1..6])},
   '[[1, 2, 3], [4, 5, 6]]');

Language::Functional defines and exports break as a normal Perl subroutine with prototype (&$).

Expected result

System Perl passes the complete upstream suite:

  • 2 test files
  • 97 tests
  • t/simple.t passes all 96 tests

Actual result

The archived CPAN run fails during compilation at t/simple.t line 77, before the planned assertions execute:

JVM backend:

Operator "break" doesn't have a defined JVM descriptor at t/simple.t line 77, near ""

Interpreter backend:

Unsupported operator: break at t/simple.t line 77, near ""

The focused test reproduces this failure on both backends. The failure is recorded under target label InfiniteList, but the failing distribution is Language::Functional 0.05.

Likely root cause

PerlOnJava reserves or dispatches break as an operator before considering the imported subroutine installed by use Language::Functional ':all'. Standard Perl resolves this source form to the imported function, including its (&$) prototype and block argument.

This is a parser/symbol-resolution compatibility defect involving imported subroutines whose names overlap with built-in or feature-related operators. It is pure Perl and does not involve XS code, native libraries, or external services.

Acceptance criteria

  • An imported subroutine named break can be called in the upstream form break { ... } $list on both JVM and interpreter backends.
  • Language::Functional 0.05 passes all 97 upstream tests without modifying its tests.
  • Add focused project-owned regression coverage for an imported subroutine shadowing or overriding a built-in/feature-related operator name.
  • Preserve genuine operator behavior when no overriding subroutine is imported.
  • Preserve prototype-aware parsing of the block argument.

Evidence

  • CPAN run: 20260918-141920-96054
  • Distribution: Language-Functional-0.05
  • Failing test: t/simple.t line 77, break { shift() >= 4 } [1..6]
  • System Perl: PASS, 2 files / 97 tests
  • PerlOnJava: FAIL before assertions in t/simple.t
  • JVM and interpreter: focused failure reproduced

Related issues

  • #19 tracks imported Time::HiRes::time failing to override the built-in time operator. It is closed and concerns a different operator, but the import-vs-core-operator resolution problem is related.
  • #1257 tracks symbol-resolution collisions between imported constants and lexical declarations. It is open and related to preserving Perl namespaces and imported symbol identity, but it does not cover operator-shaped subroutine calls.

This issue should be coordinated with those efforts while retaining Language::Functional as independent regression coverage.

Dominant language
Perl
Stars
64
Forks
6
Avg merge
5h 38m
Merged PRs (30d)
170

Contributor guide

Open the contributing guide

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.