Skip Menu |

This queue is for tickets about the File-Slurp CPAN distribution.

Report information
The Basics
Id: 76598
Status: new
Priority: 0/
Queue: File-Slurp

Owner: Nobody in particular
Requestors: perl [...]

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)

Subject: edit_file_lines and $.
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 365
Download (untitled) / with headers
text/plain 365b
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;

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to