in reply to point to previous line

tell and seek will let you do it but I don't see why you would need to.

my $pos = tell FH; $line = <FH>; seek FH, $pos, 0; # we will now read the same line if we do $line = <FH>;

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: point to previous line
by hotshot (Prior) on Mar 05, 2003 at 09:54 UTC
    You can also read the file into an array, then any navigation on the file is easy using array index:
    my @file = <AFILE>; # reading all file to an array for (@file) { ... }


    Hotshot
Re: Re: point to previous line
by hari (Novice) on Mar 05, 2003 at 11:17 UTC
    hi , tell and seek, gives and sets to the same position, but the line retrived after that is not complete.
    What do you think what may be the problem. most of the time it is 4 character afront but not consistently.
    Does seek sub neglects spaces?
    Hari