"be consistent" | |
PerlMonks |
Exists and arraysby deepakg (Novice) |
on Oct 01, 2009 at 09:52 UTC ( [id://798579]=perlquestion: print w/replies, xml ) | Need Help?? |
deepakg has asked for the wisdom of the Perl Monks concerning the following question:
Hi Folks,
Consider an array
Now exists $dow[5] returns false. I expected exists($dow[5]) to be true and defined($dow[5]) to be false. Also dumping the array (Dumper(\@dow)) shows [undef, undef, undef, undef, undef, "Sat"]. If I do $dow[5] = undef; and then do exists($dow[5]) returns true. How does exists work for arrays - do I have to explicitly initialize an element before it "sees" it? I am on perl 5.10.0 on Snow Leopard. Thanks, Deepak
Back to
Seekers of Perl Wisdom
|
|