Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

fix: support filehandles in bundled Tie::File

已关闭
#1,578 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #1673 来自 @fglock —— 已合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
perl
领域
tooling

调研方向

Start by locating the bundled Tie::File implementation and tracing how its second argument is stored, tested, and opened. Add a tracked regression test for tying an array to a writable filehandle, then run t/01_csv.t and t/02_cmData.t for AI::ConfusionMatrix on both the JVM and Interpreter backends; done means the filehandle form works and the upstream suite passes.

由索引模型根据 Issue 内容生成。

描述

bug

Summary

AI::ConfusionMatrix 0.010 cannot read CSV output through the bundled Tie::File when the caller supplies an open filehandle. Upstream Tie::File accepts this supported usage, but PerlOnJava's bundled shim treats the handle as a filename and produces an empty tied array.

CPAN evidence

Archived CPAN random-tester run 20260930-095822-89295 reported AI::ConfusionMatrix as FAIL:

  • t/01_csv.t: 12 of 13 assertions fail; all expected CSV lines are undef
  • t/02_cmData.t: passes

The relevant upstream suite passes unchanged under system Perl: 2 files and 19 tests, all successful.

The focused failing test reproduces on both PerlOnJava execution backends:

  • JVM backend: 12 of 13 assertions fail
  • Interpreter backend: 12 of 13 assertions fail

Minimal behavior difference

use Tie::File;
use File::Temp 'tempfile';

my $fh = tempfile();
print {$fh} "x\n";
tie my @lines, 'Tie::File', $fh or die $!;
print defined $lines[0] ? $lines[0] : 'undef', "\n";

System Perl prints x; both PerlOnJava backends print undef.

Likely cause

The bundled Tie::File implementation stores its second argument as filename and subsequently applies file tests and open to it. It needs to preserve upstream behavior when that argument is an already-open filehandle.

This distribution is pure Perl; no XS/native port or environmental prerequisite is involved.

Acceptance

  • Support tying Tie::File arrays to writable filehandles as well as pathnames.
  • Add a tracked regression test covering the filehandle form.
  • Verify the upstream AI::ConfusionMatrix CSV suite on both PerlOnJava backends.
主要语言
Perl
星标
64
派生
7
平均合并
4 小时 57 分钟
30 天内合并 PR
203

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。