Re: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread $Bill Luebkert
Tim Hammerquist wrote: > > "Elston, Jeremy" wrote: > > > > Greetings... > > > > Peter's solution is the one I would recommend unless you are reading large > > files and/or your system has little memory available. By reading into an > > array, the entire file will be pulled into memory. If memor

Re: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread Tim Hammerquist
"Elston, Jeremy" wrote: > > Greetings... > > Peter's solution is the one I would recommend unless you are reading large > files and/or your system has little memory available. By reading into an > array, the entire file will be pulled into memory. If memory use is an > issue, you could use som

RE: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread Elston, Jeremy
Greetings... Peter's solution is the one I would recommend unless you are reading large files and/or your system has little memory available. By reading into an array, the entire file will be pulled into memory. If memory use is an issue, you could use something like this: - open(FILE, "m

Re: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread Grant Hopwood
-start- > "Ricardo Cumberbatch L." <[EMAIL PROTECTED]> >at02/15/2001 08:24 AM >Hi every one I had to do a perl script but a need to know how in perl you >do to read the last line in a file, I no to read in a file but how to read >every time a need the last line in a file. Probably the bes

RE: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread Peter Eisengrein
There may be a better way, but this should work (untested): open(FILE,"$thefile") || die "Can't open $thefile: $!\n"; @file=; close(FILE); $lastline=pop(@file); -Original Message- From: Ricardo Cumberbatch L. [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 9:24 AM To: Perl