[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: Concernant:Re: [MacPerl] Counting the number of lines in a document




In Regards to your letter <v01540b02ada7fa112316@[132.208.99.52]>:
> How can I implement something like '$myline =3D line 8 of MYFILE' in proper =
> perl?

You either have to make your lines fixed-length records,
and use the seek command to locate the line to be read
(i.e., seek( HDL, ($line * $record_length), 0 )  ), or
you have to keep an index file alongside the data file
that tells you the location of the start of each line
in the file. I prefer fixed-length records when they do
not involve huge storage penalties.


tim.

time@ice.com  (UUCP: heifetz!tbomb!time)

USENET - a slow moving self parody... ph