TStanley has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my @value1=(1,2,3,4); my @value2=(5,6); my @value3=(7,8,9,0); my %Hash = (Key1=>\@value1,Key2=>\@value2,Key3=>\@value3); my @hasharraylengths=(); my $length = 0; foreach my $key (keys %Hash){ $length = $Hash{$key}; push @hasharraylengths, $length; } my $l = @hasharraylengths; for(my $x=0;$x<$l;$x++){ print"Length of Value: $hasharraylengths[$x]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array length within a hash
by suaveant (Parson) on Apr 23, 2001 at 21:37 UTC | |
|
Re: Array length within a hash
by arturo (Vicar) on Apr 23, 2001 at 21:42 UTC | |
|
Re: Array length within a hash
by ton (Friar) on Apr 23, 2001 at 21:39 UTC | |
|
Re: Array length within a hash
by the_0ne (Pilgrim) on Apr 23, 2001 at 21:40 UTC |