Skip to content

Fix bareword pipe filehandle method dispatch used by Expect #1314

Description

@fglock

Summary

Test::Expect 0.34 fails under PerlOnJava because its pure-Perl dependency Expect 1.38 cannot use a bareword pipe filehandle as an object method.

Reproduction

On macOS, CPAN run 20260908-215506-1375:

  • Test::Expect 0.34 under system Perl: PASS, all 20 tests
  • Test::Expect 0.34 under PerlOnJava JVM backend: FAIL, 3/20 tests
  • Test::Expect 0.34 under PerlOnJava interpreter backend: FAIL, 3/20 tests

The target fails in Expect::spawn() at the equivalent of:

pipe(FROM_CHILD, TO_PARENT) or die $!;
TO_PARENT->autoflush(1);

PerlOnJava reports:

Bareword "TO_PARENT" not allowed while "strict subs" in use

A focused reproduction using the same imports and statements fails under PerlOnJava with:

Can't locate object method "autoflush" via package "TO_PARENT"

The same reproduction succeeds under system Perl.

Expected behavior

Bareword filehandles created by pipe should be usable as filehandle objects for methods such as autoflush, matching Perl behavior.

Environment and scope

The failure is reproducible on both PerlOnJava backends. Native PTY setup is not the primary cause: the bundled IO::Pty implementation loads and its PTY tests pass; the failure occurs at pipe filehandle method dispatch before the spawned command runs.

The archived CPAN run is 20260908-215506-1375, target Test::Expect 0.34.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cpan-portCPAN compatibility ports and providersarea:ioFiles handles paths and networkingarea:runtimeCore Perl runtime semanticsbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions