Re: Coding Conservative CGI Perl

From: FBO (fbo2at_private)
Date: Mon Jun 10 2002 - 22:35:36 PDT

  • Next message: Jamil Ozelin: "Re: PGP spoof decrypted output?"

    Hi perl-fans,
    
    On Mon, Jun 10, 2002 at 08:54:41PM +0200, Joerg Over wrote:
    > Am 00:27 10.06.02 -0500 schrubst Du:
    > ->#!/usr/bin/perl
    > ->print "Content-type:text/html\n\n";
    > ->print "SUP!<BR>";
    > ->
    > ->This will not work but recoded to work (not having spaces) would be:
    > ->
    > ->#!/usr/bin/perl
    > ->print("Content-type:text/html\n\n");
    > ->print("SUP!<BR>");
    > ->
    > ->You can have just about any character other than spaces... I'm no good
    > with perl really unfournately although I have read quite a number of
    > articles the only thing I've successfully found remotely useful was using
    > print($ENV{DOCUMENT_ROOT}); to find the location of the file heh.
    > 
    > perl is quiet flexible in that respect.
    > Since you seemingly can use newlines, just use them wherever you otherwise
    > can't avoid a space.
    > 
    > #!perl
    > kill
    > $$
    > or
    > die
    > 
    IMHO no spaces, newlines or other \s-chracters are really needed in a perl
    script. 1 newline is needed whenever '#!/usr/bin/perl' at the beginning
    can't be avoided.
    
    For example:
    
    #!/usr/bin/perl
    print "foo bar blahblah
    ";
    print ( 1 and 1 ) . "\n";
    
    could be rewritten to
    
    #!/usr/bin/perl
    print("foo\040bar\040blahblah\n".((1)and(1))."\n");
    
    ->no spaces, just a single newline.
    
    perl rulez :-) ...
    
    FBO
    



    This archive was generated by hypermail 2b30 : Tue Jun 11 2002 - 10:23:08 PDT