Re: Finally a better script!
- From: Fabian Pilkowski <pilkowsk@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 00:51:04 +0200
* Henry Law schrieb:
> Nikos <hackeras@xxxxxxxxx> wrote:
>
> > if (param('select') and param('select') ne '..')
>
> And I'm sure in my own mind that this statement isn't going to do what
> you want. For a start you do realise that "ne" is higher priority
> than "and" so this is going to evaluate (param('select') ne '..')
> first (yielding a true/false value), and then take the result and
> logically "and" it with the _same_ param('select'). I may be
> completely wrong and it is exactly what you want (I'm not a skilled
> Perl-ist myself) but I can't imagine what value of param('select')
> will yield sense in that statement.
Try to read this condition as: if param is true and not equal "..". Due
to the very low precedence of »and« this construct makes sense, usually.
Consider the undefined value as param. Just comparing *undef* with the
string '..' throws a warning ("Use of uninitialized value in string ne
at ..."). Hence one is checking if param is not the undefined value (ok,
here the check tests for trueness instead of definedness).
regards,
fabian
.
- Follow-Ups:
- Re: Finally a better script!
- From: Nikos
- Re: Finally a better script!
- References:
- Finally a better script!
- From: Nikos
- Re: Finally a better script!
- From: Henry Law
- Finally a better script!
- Prev by Date: Re: CGI Post not passing values properly
- Next by Date: Re: @ARGV vanished!
- Previous by thread: Re: Finally a better script!
- Next by thread: Re: Finally a better script!
- Index(es):
Relevant Pages
|