Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: What filehandle should be used for HTML prints via CGI??

by ptum (Priest)
on Jan 12, 2007 at 18:08 UTC ( #594426=note: print w/replies, xml ) Need Help??

in reply to What filehandle should be used for HTML prints via CGI??

A CGI program in Perl generally prints a header and then simply prints the HTML to STDOUT, as has been noted. A simple (untested) "Hello World!" example follows:

use strict; use CGI; print header(); print start_html(); print h1("Hello, World!"); print end_html();

As noted, no explicit file handle is needed, since your script is simply printing to STDOUT.

Please do follow the advice you've been given and read up on CGI.

Note also that your script needs to be executable by the user under which your webserver runs. This generally means you need to chmod your script to 755 if running under some form of Unix.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://594426]
[perldigious]: No offense to any Scotsman, I love Scots. Well actually, I love Scotch, but I'm sure the people are great too. :-P
[Discipulus]: perldigious i understand i word on ten, to be optimistic..
LanX will try to give his next LPW talk with a Cogney intonation
[Discipulus]: if you love Scotch in scotland your safety will be.. glengranted
[LanX]: *Cockney
erix tries for a few glo'al stops
[Discipulus]: or was Cognac (in|s)tonation?

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2017-06-23 16:53 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (552 votes). Check out past polls.