in reply to pattern matching only last line of a file and then copy 10 lines above till end
Philuse Tie::File; my @array; tie @array, 'Tie::File', filename or die ...; if ( $array[-1] =~ /regex here/ ) { # print elemeents -10 to -1. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pattern matching only last line of a file and then copy 10 lines above till end
by holli (Abbot) on Oct 20, 2005 at 15:58 UTC |