in reply to Delete last line of file with regex
my @lines = <DATA>; if ($lines[-1] =~ /^##/) { pop @lines; } my $slurp = join '', @lines;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Delete last line of file with regex
by afoken (Chancellor) on Jul 23, 2020 at 08:18 UTC | |
by Anonymous Monk on Jul 23, 2020 at 13:50 UTC | |
by Anonymous Monk on Aug 06, 2020 at 16:40 UTC |