in reply to end of file!

You could slurp the file into an array and then get the last array offset.
@array = <FILE>; $last_line = $array[-1];

Replies are listed 'Best First'.
RE: Re: end of file!
by vnpandey (Scribe) on Jul 26, 2000 at 15:45 UTC
    Thanks...Yes it is one of the ways but is there some better way as the file is pretty huge & there is memory crunch so reading the whole file seems to be really wasting a lot of memory.. is there something which reads the file in reverse order. Thanks-vnpandey
      Indeed, there is a module called File::ReadBackwards available through CPAN. From the description in the man file:
      This module reads a file backwards line by line. 
      It is simple to use, memory efficient and fast. 
      It supports both an object and a tied handle interface. 
      
      It is intended for processing log and other similar text 
      files which typically have their newest entries appended 
      to them. By default files are assumed to be plain text and
      have a line ending appropriate to the OS. But you can set
      the input record separator string on a per file basis. 
      
      Autark.
        Thanks..I wanted exactly similar stuff. Also the comments of c-era,fundflow are quite helpful.thanks to you too!! & all the monks for their replies..-vnpandey