LPM: RE: join

Rich Bowen rbowen at rcbowen.com
Sun Apr 2 21:15:34 CDT 2000


repett0 at sac.uky.edu wrote:
> 
> ok so how do you get the length of the array?? thats the main question
> now...

If array is @foo,

$length = @foo;

That's the actual number of elements in @foo. (The jargon is "evaluate
the array in scalar context.") 

By the way, remember that array indices start with 0, so you may be
getting yourself in trouble by starting your numbering at 1. You really
should use (0..9) in your loop.

Rich
-- 
http://www.ApacheUnleashed.com/
Lexington Perl Mongers - http://lexington.pm.org/
PGP Key - http://www.rcbowen.com/pgp.txt



More information about the Lexington-pm mailing list