Home: Perl Programming Help: Intermediate:
HELP STUMPED HTML SOURCE CODE



s4hire1
New User

Aug 23, 2012, 10:43 AM


Views: 2280
HELP STUMPED HTML SOURCE CODE

I worte a perl script that stores check box information from an html form in mysql. Here is my dilema ... After all my forms have been completed I try and assemple a final report with those items and only those items that were selected. So I am trying to re-open the HTML form file and reprint it to the screen and by using regular expressions I am searching for a particular name in the name field of the check box and trying to mark it checked and only show that.

I cannot figure out for the life of me how to read the source code or just the text from the file ... alter it and then reprint it on the screen so the user can see the HTML output. example:

<input name="G13" type="checkbox">SOME VALUE</input> //

if G13 was returned from the database i want to re generate the HTML with this

<input name="G13" type="checkbox" value="checked">SOME VALUE</input>


FishMonger
Veteran / Moderator

Aug 23, 2012, 12:16 PM


Views: 2278
Re: [s4hire1] HELP STUMPED HTML SOURCE CODE

Bad approach.

Use one of the template modules on cpan, such as HTML::Template.
http://search.cpan.org/~wonko/HTML-Template-2.91/lib/HTML/Template.pm