From: "Larsen, Errin M HMMA/IT" <[EMAIL PROTECTED]> > # [EMAIL PROTECTED] will be the number of elements in the array referenced > by > $a, minus one (or, '4', in this example)
Well, yes most likely it will be, but it doesn't have to ;-) $#array is defined as the highest index in the array. The definition doesn't say anything about the number of elements. And while it's true that under normal circumstances Perl array indexes are zero based and thus the maximum index is the number of elements minus one it's not quaranteed. #perl $[ = 8; @a = (1,2,3); print "And the max index is: $#a\n"; You should not fiddle with $[ though. Unless you are creating an entry into the obfuscated code contest or a YAPH. Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>