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

Re: help with perl



On Tue, 27 May 1997 09:32:23 +1000 (EST), Craig Sanders <cas@taz.net.au> said:
>>
> One advantage of the db file is that comments are stripped out by
> makemap which means i can have as many comments as i like in the
> source text but it wont slow down the script at all [...]

You could get the same result by preprocessing any configuration file to
remove comments and blank lines.

> Also, [using a text rather than a DB file] there will also be the
> overhead of opening & closing the file for every URL, [...]

You don't have to reopen it for a text file any more than you do for a
DB file.  Keep the file open and seek() to the beginning before the
loop.  The preprocessor just has to be careful to overwrite the file in
place instead of removing or moving the old one out of the way.

> [...] plus the overhead of parsing each line into it's two fields...

DB has its own overhead, though.  Since you're always scanning the file
linearly I think the overhead will be less with the text file.  It's
just my instinct.  If I were writing the application and the speed were
important to me I'd benchmark both approaches.

>     [...] - whoever invented gif animations should be drawn and
>     quartered very slowly over a hot fire.

Amen.

-- 
Roderick Schertler
roderick@argon.org


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: