in reply to Baby Steps "if" behavior?
If I remember correctly 0, null string, and empty string are all false answers. However,
0 and empty string are defined answers. $kaka ne "" checks to see if $kaka
is equal to the empty string. Whereas defined $kaka checks
to see if $kaka is something other than 0, null, or empty. I also think there
are some differences for defined and exists. I think exists
only applies to hash values. I know this isn't a complete answer
but it gets you pointed in the right direction, I hope. Check in perlfunc for
more complete answers.
Update:
Oops. You can uses exists to check on array elements. Next time I'll read perlfunc before shooting off with the fingers.
Update:
Oops. You can uses exists to check on array elements. Next time I'll read perlfunc before shooting off with the fingers.
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: Baby Steps
by sean (Beadle) on Jun 23, 2000 at 04:04 UTC | |
RE:(2) Baby Steps (exists on array)
by Russ (Deacon) on Jun 23, 2000 at 03:15 UTC |
In Section
Seekers of Perl Wisdom