I want to delete the last line of a file but only if it begins with ###!/usr/bin/env perl my $slurp; while (<DATA>) { $slurp .= $_; }
my $slurp; while (<DATA>) { last if eof && /^###* /; $slurp .= $_; }
In reply to Re: Delete last line of file with regex
by jwkrahn
in thread Delete last line of file with regex
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |