Re: question about data structures - what does $# mean?
- From: "Dr.Ruud" <rvtol+news@xxxxxxxxxxxx>
- Date: Sat, 30 Aug 2008 17:14:44 +0200
sanjeeb schreef:
$#array gives the last index of the array not the number of elements
in the array, so you need to add 1 to $#array to get the number of
elements.
For a Perl array, the number of elements is *normally* equal to the last
index plus one, but not *necessarily*.
Check out "$[" in perlvar.
--
Affijn, Ruud
"Gewoon is een tijger."
.
- References:
- Prev by Date: Re: trouble writing a setuid script
- Next by Date: Re: question about data structures - what does $# mean?
- Previous by thread: Re: question about data structures - what does $# mean?
- Next by thread: Re: question about data structures - what does $# mean?
- Index(es):
Relevant Pages
|