Re: how to get the last line of a file

2002-10-11 Thread david
Alex Chen wrote: > hi, all > > i want to know how to get the last line of > a file .i know the func read has a paramenter offset but i don't know how > to use it.please help!!! > > thanks > alex chen try this: #!/usr/bin/perl -w; use s

Re: how to get the last line of a file

2002-10-11 Thread John W. Krahn
Alex Chen wrote: > > hi, all Hello, > i want to know how to get the last line of > a file .i know the func read has a paramenter offset but i don't know how to > use it.please help!!! 1) Install http://search.cpan.org/author/URI/File-ReadBackwards-0.98/ use File::R

RE: how to get the last line of a file

2002-10-11 Thread NYIMI Jose (BMB)
use Tie::File; tie @array, 'Tie::File', "file.txt" or die $!; my $last_line=$array[$#array]; José. > -Original Message- > From: alex chen [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 11, 2002 8:57 AM > To: [EMAIL PROTECTED] > Subject:

Re: how to get the last line of a file

2002-10-11 Thread David Garamond
alex chen wrote: > hi, all > > i want to know how to get the last line of > a file .i know the func read has a paramenter offset but i don't know how to > use it.please help!!! the easy way (but inefficient): # read until the last line open F, "file.txt" or d

Re: how to get the last line of a file

2002-10-11 Thread Jean Padilla
alex chen a écrit : > > hi, all > > i want to know how to get the last line of > a file .i know the func read has a paramenter offset but i don't know how to > use it.please help!!! > > thanks > alex chen > > -- > To unsubscri

how to get the last line of a file

2002-10-11 Thread alex chen
hi, all i want to know how to get the last line of a file .i know the func read has a paramenter offset but i don't know how to use it.please help!!! thanks alex chen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]