in reply to Re: How do I find the size of an array?
in thread How do I find the size of an array?
What's wrong with:
$length = @array;
For example:
#!/usr/bin/perl use strict; my @array = qw(one two three); my $length = $#array + 1; print "Dollar pound array = $length\n"; $length = @array; print "At symbol array = $length\n"; __DATA__ {C} > test.pl Dollar pound array = 3 At symbol array = 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Answer: How do I find the size of an array?
by merlyn (Sage) on Feb 10, 2010 at 00:53 UTC |