In perl cgi script, I need to increment perl array variable index inside script tag to add each value in array variable in each html
<p id="para1"> <p id="para2"> <p id="para3">
my @jslabel = ('1','2','3');
<p id="para0"> hi </p>
<p id="para1"> hi </p>
<p id="para2"> hi </p>
However I'd also point that html documents are better served out of "template files" and data inserted to them via modules that provide that functionality. Good examples of modules from CPAN that provide that functionality are
Template::Toolkit. However this is beyond the scope of the question.
Another alternative is to use some form of AJAX mechanism to fetch the results "live" data from a seperate CGI script and populate from the returned results (that is more of a "Web 2.0" way of approaching things).