in reply to Re^7: Grep Pattern Match
in thread Grep Pattern Match
A rather simpler test method, but in this, (only) "line 1" is printed out 10 times.
#! perl -sw use strict; my $count=1; my $regex = qr/$count/; my $told = tell DATA; my $line; for $count (1 .. 10) { $line =~ $regex and print $line while $line = <DATA>; seek DATA, $told, 0; } __DATA__ line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8 line 9
Examine what is said, not who speaks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Grep Pattern Match
by diotalevi (Canon) on Dec 27, 2002 at 19:48 UTC |