[H-GEN] Perl Novitiates (was: CGI Troubles.)

Ewan Edwards ewane at mincom.com
Tue May 15 00:26:08 EDT 2001


[ Humbug *General* list - semi-serious discussions about Humbug and  ]
[ Unix-related topics.  Please observe the list's charter.           ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]

On Tue, 15 May 2001, Jason Henry Parker wrote:
> [ Humbug *General* list - semi-serious discussions about Humbug and  ]
> [ Unix-related topics.  Please observe the list's charter.           ]
> [ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]
> 
> On Tue, May 15, 2001 at 09:52:47AM +1000, Clinton Roy wrote:
> > So, (assuming that Perl doesn't add newlines when it prints,
> 
> Only if you run the interpreter with the -l option, which has other
> magic associated with it.
> 
> > like
> > Python does), I'd expect something like the following to work:
> > 
> > #! /usr/bin/perl
> 
> For fecks sake!  -w!  -w!  USE -w!  USE STRICT!
> 
> > print "Content-type: text/plain\r\n";
> > print "\r\n";
> > print "foo";
> 
> Are you people trying to troll me into a Perl presentation or what?

YES PLEASE !

> 
>   #!/usr/bin/perl -w
> 
>   =head1 NAME
> 
>   sample.pl - show folks how to code CGI in perl (more) correctly
> 
>   =cut
> 
>   =head1 BUGS
> 
>   Uses the more simple procedural interface to CGI.pm instead of the
>   object-oriented interface, in deference to simplicity.
> 
>   =cut
> 
>   use strict;
>   # use diagnostics; # for 5.6.0 and above only
> 
>   use CGI qw/:standard :netscape/;
> 
>   print header,
>     start_html('This is how one writes CGI scripts in perl'),
>     h1('USE the -w flag'),
>     blink('Code without the -w flag is like running with scissors.'),
>     h1('USE STRICT'),
>     blink('The strict pragma can save you from entire worlds of hurt.'),
>     end_html;
> 
> jason
> -- 
> ||----|---|------------|--|-------|------|-----------|-|     |--||----|-|
> | Jason Henry Parker                      play:        jasonp at uq.net.au |
> | Available on #soc.bi on openprojects    work:  jparker at pisoftware.com |
> ||--|--------|--------------|----|-------------|------|---------|-----|-|
> 
> --
> * This is list (humbug) general handled by majordomo at lists.humbug.org.au .
> * Postings to this list are only accepted from subscribed addresses of
> * lists 'general' or 'general-post'.


-- 
This transmission is  for the intended  addressee only and is confidential
information.  If you  have  received  this  transmission in error,  pleased
 elete  it and  notify  the sender.  The contents of this  e-mail are  theo
 pinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list