Gokcen Ogutcu wrote:

> hi all,
> 
>  
> 
> when reading a file line by line, i sometimes need to check two lines 
> after the current line, how can i do this?


You can just go ahead and read two lines.  Eg:

        my $line1 = <FH>;
        my $line2 = <FH>;

If you need to go back in the file for some reason, you could use tell
and seek to save the file position and return to it.  It's probably easier
to just set a flag that says you have lines saved or maybe write a sub to
read lines ahead for you and return current or +n line.

Your question is poorly stated in that it requires the reader to make all
sorts of assumptions on what you mean and what you are trying to do.

PS:  Please post in plain text only.
-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to