newrisedesigns has asked for the wisdom of the Perl Monks concerning the following question:
Hello fellow monks,
I am in the process of writing a weblog page for my website which will be driven by Perl. Currently, I have the program slurp in the weblog file (plain-text, with a record delimiter) and spit the chunks back out.
Slurping is a sin, and I wish to become enlightened. I want to rewrite the code (it's not yet live) so the weblog isn't slurped from a file. I'm considering using a 'while' loop, however, I'm not sure how I can keep track of the file. I have an "offset" modifier and a "span" modifier, which allows users to start at a point in the log and read through however many entries they requested.
Currently, I have a $count variable in the 'while' loop, and some 'if' statements which determine which entries are pulled. I am under the assumption that I can use $_ to read from <WEBLOG> and $. to get the current entry (as i would in $weblog[$currententry]).
Is this the most efficient form of reading from a file? Any suggestions?
a somewhat lost John J Reiser
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Anti-slurp weblog
by Zaxo (Archbishop) on Jan 21, 2002 at 12:25 UTC | |
|
Re: Anti-slurp weblog
by trs80 (Priest) on Jan 21, 2002 at 10:50 UTC | |
|
Re: Anti-slurp weblog
by grep (Monsignor) on Jan 21, 2002 at 09:32 UTC | |
|
Re: Anti-slurp weblog
by n3dst4 (Scribe) on Jan 22, 2002 at 00:07 UTC | |
by newrisedesigns (Curate) on Jan 22, 2002 at 06:12 UTC |