in reply to editing files with (<>)
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: editing files with (<>)
by Skeeve (Parson) on Dec 21, 2004 at 09:19 UTC | |
by Aristotle (Chancellor) on Dec 21, 2004 at 09:43 UTC |