Re: if statement
- From: "Tassilo v. Parseval" <tassilo.von.parseval@xxxxxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 08:52:50 +0200
Also sprach A. Sinan Unur:
> "Chris H" <socialism001@xxxxxxxxx> wrote in
> news:1130456186.193121.312170@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
>> $newline2 =
>> join(',','code9',$ENV{'REMOTE_HOST'},$now_string,$ENV{'REMOTE_ADDR'},
>> $query->param('email'),$query->param('distribution'),
>> $query->param('-max'),$query->param('-min'),$query->param('~=use'),
>> $query->param('~=city'))
>> ;
>
> Are you trying to make your code hard to read on purpose?
>
> my $newline2 = join(',',
> 'code9',
> $ENV{'REMOTE_HOST'},
> $now_string,
> $ENV{'REMOTE_ADDR'},
> $query->param('email'),
> $query->param('distribution'),
> $query->param('-max'),
> $query->param('-min'),
> $query->param('~=use'),
> $query->param('~=city')
> );
Come one, you can do better than that. ;-) The six calls to param() are
a job for a type-writing monkey. Or map:
my $newline2 = join ',',
'code9',
$ENV{REMOTE_HOST},
$now_string,
$ENV{REMOTE_ADDR},
map $query->param($_),
qw/email distribution -max -min ~=use ~=city/;
> Note that IMHO $query is not a great name for the CGI object (even
> thought the docs use it). I prefer to use $cgi.
And it even saves two unnecessary keystrokes.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
.
- Follow-Ups:
- Re: if statement
- From: Dave Weaver
- Re: if statement
- References:
- Re: if statement
- From: A. Sinan Unur
- Re: if statement
- Prev by Date: Re: stat() bug
- Next by Date: Re: to parse a string
- Previous by thread: Re: if statement
- Next by thread: Re: if statement
- Index(es):