Here's the rub - If you move to HTML::Template, the Javascript is now in a text file. More importantly, it's in a text file you can test without the use of Perl. So, you can get your Javascript right, THEN add in the Perl code.
What I mean is that you build your HTML file and get it right with mocked up data. Then, you replace the mocked up piece with data from your script. But, by that point, you will know the Javascript is correct, so you don't have worry about it.
------
We are the carpenters and bricklayers of the Information Age.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
| [reply] |
As a general point, I would remove the JavaScript to a seperate js file which is refered to in the head section of your HTML file using a <SCRIPT SRC="myscript.js" /> tag.
This adds a little more useful code / presentation seperation which improves your ability to test and may lead you to produce reusable code.
inman | [reply] |