http://www.perlmonks.org?node_id=150496


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; }

Replies are listed 'Best First'.
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/