J
John Bokma
Gregory said:However, the more modules you load the slower your cgi runs.
On the web, speed isn't everything, its the ONLY thing.
Early optimizing can be a nice way to shoot yourself in the foot.
Gregory said:However, the more modules you load the slower your cgi runs.
On the web, speed isn't everything, its the ONLY thing.
michael said:I'm doing a site which will have a navigation menu in the form of an
unordered list, containing groups of URLs and corresponding link names,
which may be defined in simple arrays, eg.:
@flora_and_funa_URLs = ("z0.html","z1.html","z2.html");
@flora_and_funa_Names = ("Flora & Funa", "Pretty Flowers", "Deadly Vines");
It really is as simple as a loop & print statement. You can go down the
route of using templates if you want.
Gregory Toomey said:There are modules like HTML::Template or CGI.pm
http://search.cpan.org/dist/CGI.pm/CGI.pm
However, the more modules you load the slower your cgi runs.
On the web, speed isn't everything, its the ONLY thing.
michael said:@flora_and_funa_URLs = ("z0.html","z1.html","z2.html");
@flora_and_funa_Names = ("Flora & Funa", "Pretty Flowers", "Deadly Vines");
michael said:Thanks for the tip, first time I've heard of LoH's...
the above, including an
@aquatic_creaturs LoH's,
If so, please kindly post your code.
perldoc perlref
perldoc perllol
perldoc perldsc
I would now suggest a different "better" structure, a HoLoH:
Thanks!
Show us the code you've already tried, and we will help you fix it.
Michael said:<li class="in_group"><a href="z3.html">Aquatic Creatures</a>
<ul>
<li class="this_URL"><a href="z4.html">Pretty Fish</a></li>
<li class="in_group"><a href="z5.html">Don't Eat</a></li>
</ul>
</li>
It is obviously necessary know which URL is accessed, ...
How can a current URL or filename portion be accessed in Perl?
Any ideas including code snippets (or chunks) would be greatly appreciated,
especially with regards to transforming the above arrays into the
examplified html structure, perhaps by using a for loop?
accessing a URL, it is the case of creating a file that will
become the target of a URL.
It is simple: use a for() loop to generate your html.
michael said:Sounds right too. I found that $ENV{"DOCUMENT_NAME"} does what I need.
michael said:As a non-perl scripter I have some likely basic questions:
How can a current URL or filename portion be accessed in Perl?
Are there any modules that may be useful in this example, or would it
perhaps be easier to write a script for the purpose?
In which ways could all be easily done?
Any ideas including code snippets (or chunks) would be greatly appreciated,
especially with regards to transforming the above arrays into the
examplified html structure, perhaps by using a for loop?
Hmm.. that much explain the multitude of sites not working properly
(and failing extremely fast...).
Modules tend to create more consistent code, as well as more consistent
HTML. Consistent code may offer possibilities of higher-level
optimisations, whereas consistent HTML renders more predictably in the
various browsers.
So, optimise for speed when speed is the problem. Which does not mean
that one is allowed to write excessively slow code by default.
As for optimising for speed, the largest slowdown with modules tends to
be the module load/initialisation time. This can largely be avoided with
switching from plain CGI to either mod_perl or FastCGI execution
environments -- so, there are other (better) ways to gain speed than
discard use of modules.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.