[prog] perl woes...

Patricia Fraser trish at thefrasers.org
Sun Jun 1 23:05:55 EST 2003


Hi Wolfgang,

> Now I wanted to know myself. And surprisingly, it wasn't as
> complicated as I had expected. :-)

I went and looked too, and I found a Javascript snippet very similar to 
the perl you've shown, but I balked for a couple of reasons:

First, I'm sort of following Jacinta's idea of data accuracy by staying 
away from client-side scripts - the user-base we're looking at includes 
minimal geeks, so the chances of odd things happening that might cause 
problems with the database have to be minimised.

Second, as Jacinta said, HTML::Template simply doesn't work this way. I 
can't seem to work out a way to use a here-document to populate a 
drop-down list from a database table of unknown size (since from user 
to user the lists could change markedly, since they're lists of 
products, shippers, suppliers &c) - it seems to require me to stipulate 
the number of options in a list, even if those options are populated by 
variables, when what I needed was the looping ability of the TEMPL_VAR 
tag that this module allows. 

The Javascript code I found at scriptsearch.com, under forms 2D and 3D, 
seems to have the same drawback as the here-doc method (which I already 
knew had a way to refresh the page). 

And although HTML::Template does this random-size list population 
handily, once the .tmpl file has been served, it has been served - I 
then have to pass the variables I've garnered from that page to a new 
script, and can't preserve them while re-loading the page with an added 
extra.

Anyway, it has all been hugely educational and enjoyable - thanks to 
everyone for help! and Stage 1 is working like a charm, grabbing 
variables and inserting new transactions and details into the various 
tables just as it ought. 

8-)

-- 
Trish Fraser, Sunbury, Australia
Linux user #283226  counter.li.org
cassiopeia up 26 days and counting
kernel 2.4.18-6mdk


More information about the Programming mailing list