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.
Summary
Test::Expect0.34 fails under PerlOnJava because its pure-Perl dependencyExpect1.38 cannot use a bareword pipe filehandle as an object method.Reproduction
On macOS, CPAN run
20260908-215506-1375:Test::Expect0.34 under system Perl: PASS, all 20 testsTest::Expect0.34 under PerlOnJava JVM backend: FAIL, 3/20 testsTest::Expect0.34 under PerlOnJava interpreter backend: FAIL, 3/20 testsThe target fails in
Expect::spawn()at the equivalent of:PerlOnJava reports:
A focused reproduction using the same imports and statements fails under PerlOnJava with:
The same reproduction succeeds under system Perl.
Expected behavior
Bareword filehandles created by
pipeshould be usable as filehandle objects for methods such asautoflush, 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::Ptyimplementation 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, targetTest::Expect0.34.