Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Calling functions in middle of CGI HTML declarations

by flexvault (Parson)
on Aug 26, 2012 at 18:04 UTC ( #989858=note: print w/ replies, xml ) Need Help??


in reply to Calling functions in middle of CGI HTML declarations

dr.jekyllandme,

Since you're learning about CGI, I did a post about a tool here that allows you to keep the Perl code and the HTML files separate. The more I use it, the better I like it.

My cgi scripts are smaller and faster as a result of this technique.

I have expanded my use of the hash (%TWORK) so that now I keep all input fields and all calculated results in the same hash. I use 'read' to slurp the file in all at once, and then I call the subroutine once, and then print the output to the web server. You can have someone else(web/graphic designer) edit the HTML file, and your code stays intact.

Good Luck!

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Calling functions in middle of CGI HTML declarations
Re^2: Calling functions in middle of CGI HTML declarations
by Mr. Muskrat (Abbot) on Aug 26, 2012 at 18:45 UTC

      You're entitled to your opinion!

      You're not entitled to tell me what my opinion is!

      Thank you!

      "Well done is better than well said." - Benjamin Franklin

        It's the opinion of the Perl community at large. I just happen to agree with it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989858]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-12-22 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (121 votes), past polls