in reply to testing for the zero length string (blank value) in cgi fields

A number of people have pointed out your problems with quotes, but no-one has yet simplified your test. If you change it to

if (param($neg)) {

then you'll cover the case where the value isn't set, but also the case where the input doesn't exist.

Update: blakem is absolutely right!

--
<http://www.dave.org.uk>

"The first rule of Perl club is you don't talk about Perl club."

  • Comment on Re: testing for the zero length string (blank value) in cgi fields
  • Download Code

Replies are listed 'Best First'.
Re: Re: testing for the zero length string (blank value) in cgi fields
by blakem (Monsignor) on Oct 25, 2001 at 00:08 UTC
    That's inverted... I think you mean:
    unless (param($neg)) { # or if (!param($neg)) {

    -Blake