in reply to How do you determine the size of array reference?
my $ar1 = [qw(this is another element)]; my $ar2 = [ 'this','is','another','element']; my @a1 = ('this','is','another','element'); my @a2 = (qw(this is another element)); printf " \$ar1 has %s elements \$ar2 has %s elements \@a1 has %s elements \@a2 has %s elements ", scalar @$ar1, scalar @{$ar2}, scalar @a1, scalar @a2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you determine the size of array reference?
by apl (Monsignor) on Jul 02, 2007 at 17:21 UTC |