[thelist] Perl problem and question

Dean Mah dsmah at home.com
Mon Aug 6 19:59:02 CDT 2001


The header() subroutine is useful for mixing mod_perl and CGI scripts
as it will do the right thing regardless.  So you can use the same
scripts (with conditions) in either environment.  It also provides you
an interface to push things into the header other than the content
type like cookies and pragmas.

Dean


Poojie writes:

> CGI.pm does more than just parsing the HTTP Header variables; it's
> major "feature" is that it allows programmers to remain programmers
> (ie: they can stay away from web design, HTML, etc...). More
> specifically, CGI.pm provides an interface for creating HTML forms
> as well as the controlling the HTTP header (ie: the Content-type,
> Location, etc...). Certain routines are pretty useless, such as
> this one:
> 
> use CGI;
> my $q = new CGI;
> print $q->header('text/html');
> 
> I suppose this functionality is included for the sake of
> simplicity, but still... I prefer:
> 
> print "Content-type: text/html\n\n";




More information about the thelist mailing list