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.
In reply to Re: Re^7: Grep Pattern Match
by BrowserUk
in thread Grep Pattern Match
by LostS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |