Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
We don't bite newbies here... much
 
PerlMonks  

Re: Inserting CGI code in script tag

by Arguile (Hermit)
on Oct 23, 2001 at 19:47 UTC ( #120823=note: print w/ replies, xml ) Need Help??


in reply to Inserting CGI code in script tag

Consistancy

Mixing your metaphors, ie. using CGI OO with flat HTML interpolation can get really messy and confusing. You might consider sticking with one, or even better use a templating system if you'll be doing multiple different pages.

These are my favourites (there are many other systems as well):

Here Docs

print <<"HTML"; This is what's called a here doc. HTML

Anything between the <<LABEL and the end LABEL, which must be on a line all by itself, will be interpretted as a string. You don't have to worry about quoting conventions. A straight here doc is like single quoting in Perl ('), but if you add the double quotes around the first label (") perl will interpolate your variables (substitute them).

select()

select REFRESH; print "Test";

"Test" will now be printed to the REFRESH handle. When you select a handle it becomes the active handle. Click the link for more info, and remeber to reset it when you're done!.

See Also


Comment on Re: Inserting CGI code in script tag
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-04-21 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (489 votes), past polls