new_2_perl has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: printing header method
by myocom (Deacon) on Jun 07, 2001 at 04:05 UTC

    A cursory glance at the CGI docs indicate that yes, it does. Here's the example they give that uses it:

    #!/usr/local/bin/perl use CGI; # load CGI routines $q = new CGI; # create new CGI object print $q->header, # create the HTTP header $q->start_html('hello world'), # start the HTML $q->h1('hello world'), # level 1 header $q->end_html; # end the HTML
(Ovid) Re: printing header method
by Ovid (Cardinal) on Jun 07, 2001 at 05:47 UTC
    Yes, it's called "header".
    use CGI qw/:standard/; print header; ...
    The default content type is text/html, but you can specify a different one if you like:
    print header( 'text/plain' );

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: printing header method
by tachyon (Chancellor) on Jun 07, 2001 at 16:29 UTC
    #!/usr/local/bin/perl use CGI; $query = new CGI; $query->header( -type => 'text/html', -expires => '-1d', -Pragma => 'no-cache', -Cache-control => 'no-cache' -Read => 'Docs');

    Yes this will send a header:

    Read: Docs

    So you may send any header info you like, although some are more likely to be more useful than others. Even a cursory search for CGI.pm and then header would have given you this info. Perhaps you might consider this in the future as it is quicker and will stop you getting progressively ruder answers when you ask questions clearly covered in the online documentation. Click here for the official CGI.pm docs

    tachyon