Subject: | edit_file_lines and $. |
When in a "while(FH)" loop, Perl sets the variable "$." to be the
current line number. It would be nice if edit_file_lines did the same.
Seems as easy as replacing this:
my @edited_data = map { $edit_code->(); $_ } @$existing_data ;
with this:
my $line_number = 0;
my @edited_data = map {
local $. = ++$line_number;
$edit_code->();
$_
} @$existing_data;