APM: Next dumb Q: IF NULL????

Wayne Walker wwalker at bybent.com
Tue Oct 17 16:57:21 PDT 2006


if is lower case.

if ( (! defined $product) || ($product == undef))

On Tue, Oct 17, 2006 at 04:51:42PM -0500, CaptNemo wrote:
> Why is it so hard to check for null values in perl!?!?!
> 
> 
> Two situations:
> 
> 
> 1) checking is a variable is empty:
> 
> 	IF ($product eq "")...
> 	IF ($product <> "")...
> 	IF ($product ne "")...
> 	IF ($product != "")...
> 	IF ($product eq NULL)...
> 	IF ($product <> NULL)...
> 	IF ($product ne NULL)...
> 	IF ($product != NULL)...
> 
> 
> 2) checking to see if command line args were present:
> 
> 	IF ($ARGV[0] eq "")...
> 	IF ($ARGV[0] <> "")...
> 	IF ($ARGV[0] ne "")...
> 	IF ($ARGV[0] != "")...
> 	IF ($ARGV[0] eq NULL)...
> 	IF ($ARGV[0] <> NULL)...
> 	IF ($ARGV[0] ne NULL)...
> 	IF ($ARGV[0] != NULL)...
> 
> 	...none seem to work.  HOW do you check for NULL values!?!?
> 
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin

-- 

Wayne Walker

www.unwiredbuyer.com - when you just can't be by the computer

wwalker at bybent.com                    Do you use Linux?!
http://www.bybent.com                 Get Counted!  http://counter.li.org/
Perl - http://www.perl.org/           Perl User Groups - http://www.pm.org/
Jabber:  wwalker at jabber.gnumber.com   AIM:     lwwalkerbybent
IRC:     wwalker on freenode.net


More information about the Austin mailing list