Jump to content

Here 's an example web form-based perl script


G+_Joe Maruschek
 Share

Recommended Posts

Here's an example web form-based perl script.  This time, it's just a simple calculator.  You can see it in action on my site at http://joemaruschek.com/test/web_calc.pl

 

I designed the script to draw the empty form and also receive data from the form, which is a little different than what Patrick showed us where he had a separate HTML file with the form.  Instead of just printing the results, I put the received values back in the form so you can change something and submit it again.

 

I also used some different forms of the IF statement, where I put everything on one line to make things clear and less cluttered.  I also used a version of the IF statement that they haven't shown us yet where you can place the IF condition AFTER the statement that usually goes inside the brackets.  Sometimes it just makes things clearer when you use that form.

https://github.com/joemarus/perl_examples/blob/master/web_calc.pl

Link to comment
Share on other sites

 Share

×
×
  • Create New...