in reply to Define string on current line, then match other lines with string below the line
while (my $line = <$info>) { my $next_line_start = tell($info); # save start position of next l +ine if ($line =~ /regex/) { do_something_here; } # reposition at $next_line_start seek($info,$next_line_start,0); }
Update: removed defined in the while test, as it is included (here, at least) in while magic.
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|