Multidimensional array length
- From: nospam@xxxxxxxxxxxxx
- Date: Fri, 30 Jun 2006 16:35:31 +0300
I want to know the item count of a multidimension array:
#!c:/perl/bin/Perl.exe
@test=();
$test[0][0]=5;
$test[0][1]=7;
$test[0][2]=9;
$test[1][0]="Hello";
$test[1][1]="Goodbuy";
print length($test[0])."\n"; # should get 3 but I get 16???
print $#test[0]."\n"; # produces error
print @test[0]."\n"; # produces string: ARRAY(0x1b0f190) What-the..?
print @test."\n"; # produces 2, but that's not what I'm after
.
- Prev by Date: Re: A string & a list
- Next by Date: Removing print statements from cgi script
- Previous by thread: A string & a list
- Next by thread: Removing print statements from cgi script
- Index(es):