in reply to unreadline function?

You could always use tell and seek...
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

Replies are listed 'Best First'.
Re: Re: unreadline function?
by Anonymous Monk on Mar 01, 2004 at 04:32 UTC
    how did you know about seek and tell?