Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Script not returning header

by screamingeagle (Curate)
on Mar 09, 2002 at 04:02 UTC ( #150496=note: print w/ replies, xml ) Need Help??


in reply to Script not returning header

Update
maybe you should specify the content-type first ?
you are also using a semi-colon instead of a comma at the end of print header here's a sample code (stolen from the documentation :-) )

print header, start_html('A Simple Example'), h1('A Simple Example'), start_form, "What's your name? ",textfield('name'),p, "What's the combination?", p, checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','minie']), p, "What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']),p, submit, end_form, hr; if (param()) { print "Your name is",em(param('name')),p, "The keywords are: ",em(join(", ",param('words'))),p, "Your favorite color is ",em(param('color')), hr; }


Comment on Re: Script not returning header
Select or Download Code
Re: Re: Script not returning header
by Chady (Priest) on Mar 09, 2002 at 08:48 UTC
    "you are also using a semi-colon instead of a comma at the end of print header "

    so?? do you think that's the problem?

    using semi-colon means that it's the end of the statement, while a comma means a list, what you are actually doing, is using a list with a single print statement.. and this is not the problem here.

    This:
    print header, start_html('A Simple Example');
    basically does the same thing as :
    print header; print start_html('A Simple Example');

    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-12-28 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (177 votes), past polls