in reply to Specified Line Searching in file!
my( $found, $lineno ); while ( <DATA> ) { if ( /keyID/ ) { $found = $_; $lineno = $.; print "Found $found at line $lineno.\n"; last; } }
That ought to get through your file in pretty short order, and won't consume copious amounts of memory.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Specified Line Searching in file!
by brionius (Sexton) on Jul 29, 2004 at 20:09 UTC |