Skip to content

Template::Like filehandle input does not populate scalar-reference output #1216

Closed

Description

@fglock

Summary

Template::Like 0.12 fails its filehandle-input test under both PerlOnJava backends. The same suite passes completely under system Perl.

Reproduction

use strict;
use warnings;
use Test::More tests => 1;
use Template::Like;

my $path = "template-like-repro-$$.tmpl";
END { unlink $path }

open my $write_fh, ">", $path or die "create $path: $!";
print {$write_fh} "[% group %]\\n";
close $write_fh;

open my $input_fh, "<", $path or die "open $path: $!";
my $template = Template::Like->new;
my $output;
$template->process($input_fh, { group => "hoge foo bar" }, \\$output)
    or die "process failed";
close $input_fh;

is($output, "hoge foo bar\\n", "filehandle input writes to scalar output");

Results

  • System Perl: passes all 119 tests in the distribution.
  • PerlOnJava JVM backend: the reproducer fails; the output scalar is empty/undefined.
  • PerlOnJava interpreter backend: same failure.
  • Other Template::Like input forms in the distribution test pass.

The archived CPAN run 20260902-105746-25731 recorded this as a regression: the previous pass was on 2026-08-18 at commit e9739bcbf. The original failing test is t/input.t, test 3 (filehandle).

Likely area for investigation: shared filehandle input and scalar-reference output handling in Template::Like->process().

Activity

  1. added
    bugSomething isn't working
    area:ioFiles handles paths and networking
    on Sep 2, 2026
  2. fglock commented on Oct 13, 2026

    @fglock
    OwnerAuthor

    Follow-up while PR #1781 is in CI:

    • The exact reproducer from this issue now passes on system Perl, the PerlOnJava JVM backend, and the interpreter backend.
    • The full upstream Template::Like 0.12 t/input.t passes on system Perl. On this branch the JVM backend passes its filehandle assertion, but the interpreter run still fails that assertion (and related file-based input assertions) after earlier test cases have run.

    PR #1781 adds focused coverage for scalar-reference output from filehandle input, but does not resolve this broader interpreter-only sequence failure. Please leave this issue open for that follow-up.

  3. fglock commented on Nov 4, 2026

    @fglock
    OwnerAuthor

    State: released
    Agent/session: codex-2026-11-04-io-regressions
    Scope: #1216; verify Template::Like filehandle input to scalar-reference output.
    Work: ready-for-review PR #1971, branch fix/1216-filehandle-scalar-coverage, based directly on master at head e99929c.
    Checkpoint: 2026-11-04; PR #1971 adds real-filesystem input coverage and no longer depends on #1649.
    Evidence: filehandle_input_real_file_scalar_output.t passes system Perl, JVM, and interpreter. Template::Like 0.12 t/input.t passes 13/13 on all three runtimes using the exact PR build. nice -n 19 timeout 3600 make passes on e99929c in 8m51s.
    Resolution: the previously reported interpreter sequence failure no longer reproduces; PR #1781 contains the underlying I/O fix. Issue #1216 is closed with the retest evidence; #1971 remains open for review.
    Next: respond to review on PR #1971.

  4. fglock commented on Nov 4, 2026

    @fglock
    OwnerAuthor

    Retested Template::Like 0.12 t/input.t on the exact PR #1971 build e99929c: 13/13 pass on system Perl, JVM, and interpreter. The filehandle-input assertion passes after the earlier input cases on all three runtimes. PR #1781 contains the underlying I/O fix; PR #1971 adds direct real-file regression coverage and is open for review. Closing as resolved.

  5. added a commit that references this issue on Nov 4, 2026
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 networkingbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions