Skip to content

WIP: fix 'Subroutine pipe redefined' warning in FileHandle.pm#428

Merged
fglock merged 1 commit into
masterfrom
fix/filehandle-pipe-redefined
Apr 3, 2026
Merged

WIP: fix 'Subroutine pipe redefined' warning in FileHandle.pm#428
fglock merged 1 commit into
masterfrom
fix/filehandle-pipe-redefined

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 3, 2026

Summary

  • Remove duplicate sub pipe definition in FileHandle.pm that caused Subroutine pipe redefined at jar:PERL5LIB/FileHandle.pm line 109 warning

Root Cause

sub pipe was defined twice in src/main/perl/lib/FileHandle.pm:

  1. Lines 41–46 (early definition): Added to ensure defined(&pipe) returns true before the IO::Handle->import() filter on line 52, preventing IO::Handle from overwriting it
  2. Lines 103–108 (original definition): The original location that was never cleaned up when the early copy was added

When warnings were enabled (e.g. via jcpan -j 8 -t DateTime::Format::ICal), the second definition triggered the redefinition warning.

Fix

Removed the second (redundant) sub pipe definition and its outdated comment block. The early definition at lines 41–46 is sufficient and correctly placed before the import guard.

Test plan

  • make passes (build + all unit tests)
  • Verify ./jcpan -j 8 -t DateTime::Format::ICal no longer shows the warning

Generated with Devin

The `sub pipe` function was defined twice in FileHandle.pm:
- Lines 41-46: early definition added to ensure defined(&pipe) returns
  true before the IO::Handle import filter on line 52
- Lines 103-108: the original definition that was never removed

This caused a "Subroutine pipe redefined" warning when warnings were
enabled (e.g. via jcpan -j 8 -t DateTime::Format::ICal).

Remove the second (redundant) definition. The early definition at
lines 41-46 is sufficient and correctly placed.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock fglock merged commit c787eff into master Apr 3, 2026
2 checks passed
@fglock fglock deleted the fix/filehandle-pipe-redefined branch April 3, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant