my $lpos = tell(DATA); # remember where I was while (<DATA>) { print "$_"; if ($_ =~ /another/) { # if this line has what I want seek DATA, $lpos, 0; # rewind to beginning of line print <DATA>; # and read it again } $lpos = tell(DATA); # save offset to the beginning # of the next line } __DATA__ This is a line This is another line
In reply to Re: unreadline function?
by Roger
in thread unreadline function?
by aquarium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |