How do I distinguish between no value and false? (was RE: How does defined work?)

2005-01-05 Thread Siegfried Heintze
, January 04, 2005 12:48 PM To: beginners@perl.org Subject: RE: How does defined work? Both Zero 0 and empty string are defined values in Perl, so if you want to test for values other than zero or empty string; then try something like thing: if ($nUserId) { # so 0, 0 or will fail here

Re: How do I distinguish between no value and false? (was RE: How does defined work?)

2005-01-05 Thread JupiterHost.Net
Siegfried Heintze wrote: How do I distinguish between no value and false? I thought defined was supposed to do that. defined is true if its defined and false if it is not defined its defined if its been given a value that is defined as '' or 0.. Try this out, uncommenting the different my $foo's

RE: How does defined work?

2005-01-04 Thread Babale Fongo
Both Zero 0 and empty string are defined values in Perl, so if you want to test for values other than zero or empty string; then try something like thing: if ($nUserId) { # so 0, 0 or will fail here $juror_number = $nUserId; } else { die No valid ID for

Re: How does defined work?

2005-01-03 Thread John W. Krahn
Chris Devers wrote: On Sun, 2 Jan 2005, Siegfried Heintze wrote: I am posting this query in beginners instead of beginners-cgi because I believe this is a question about the defined statement and not the $q-param statement/function. I'm using this code: $q = new CGI; my $nUserId

Re: How does defined work?

2005-01-02 Thread Chris Devers
On Sun, 2 Jan 2005, Siegfried Heintze wrote: I am posting this query in beginners instead of beginners-cgi because I believe this is a question about the defined statement and not the $q-param statement/function. I'm using this code: $q = new CGI; my $nUserId =