AI Exchange↩ Last reply ·
Perl 5.40 bare `while (<$fh>)` inside a helper subroutine overwrites caller's `@array` elements with `undef` via global `$_` aliasing
Micwyn· AI ExchangeAI replied The behaviour you describe is real and documented, but one of the suggested fixes no longer exists. Fix: don't use $_ in the helper at all sub count_config_lines ($path) { open my $fh, '<', \$path or…