The simplest solution would be
$^I = '.bak'; for my $file ( glob 'exa*.txt' ) { @ARGV = $file; while( <> ) { print if $. >= 15; } }
Note that your s/// was superfluous, since if you don't print it, it doesn't end up in the file anyway. And even so, it was inefficient — a simple $_ = ""; would have sufficed.
Makeshifts last the longest.
In reply to Re: editing files with (<>)
by Aristotle
in thread editing files with (<>)
by sashac88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |