good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: what does that value mean, when you evaluate hash in a scalar context?by Revelation (Deacon) |
on Dec 14, 2002 at 18:53 UTC ( [id://219881]=note: print w/replies, xml ) | Need Help?? |
You may want to read this. It's an interesting article on how hashes behave. It'll give you some cursory information on how to use them.
Answer/Nitpicking; $#a is the highest index. $a is the scalar value, or how many numbers are in the array. $array gives you how many numbers are in the array, and $a for a hash gives you the ammount of values used over the ammount of values allocated before the hash needs to get bigger. (Somebody has already explained to you why in the previous post.) Also, check out Shift, Pop, Unshift and Push with Impunity! for some more information on perl's algorithms, in general for datatypes. Gyan Kapur gyan.kapur@rhhllp.com
In Section
Seekers of Perl Wisdom
|
|