Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Basic CGI

by snapdragon (Monk)
on Apr 06, 2001 at 12:54 UTC ( [id://70433]=note: print w/replies, xml ) Need Help??


in reply to Basic CGI

the idea of the two files that Chady posted is probably what you want in terms of how to have two files, where one file contains HTML embedded in functions and one file contains the the 'controlling' parameters (i.e. which functions to call).

All I'd add is be careful when using the here document tags. As Chady showed the here document allows HTML to be written as raw text without having to escape quotes, put in print statements etc. The basic syntax is to have a print << followed by the ending tag. So you end up with something like:

print <<Ending_tag; Ending_tag

For the ending tag to work there are a few *important* rules to remember:

  • The ending tag must be all the way on the left hand side with no spaces before it and there can be nothing else on the line (not even a comment).
  • The line does not end with a semi-colon
  • You can call the tag pretty much anything, but it is case sensitive.

    Have fun playing around with it (and Perl as a whole).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found