Well, I don't know how to pick a reference like this... but I guess 
using a hash of array may also fulfill your job...
my @code = ('001', '002', '003', '004');
my @name = ('Joe', 'May', 'Bob', 'Foo');
my @birth= ('Jan', 'Feb', 'Mar', 'Apr');
my %Data = (Code=>\@code, Birth=>\@birth, Name=>\@name );
print $Data{Name}[2]; # So you get "Bob"

If you want to know what 'fields' inside %Data :
@DataKeys = keys(%Data);
print "@DataKeys"; # So you get "Code, Birth, Name"...
# However, the elements order in @DataKeys is not base
#on how's the order you create your key field in %Data.

If you want to know how many elements inside @DataKeys :
$total = $#DataKeys;
print $total;

rgds,
Connie

----- Original Message ----- 
From: "Alex B." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 05, 2002 10:52 PM
Subject: array of arrays :: part2


> Hi,
> 
>  I've read http://webmaster.indiana.edu/perl56/pod/perllol.html and
>  this cleared some points. :)
> 
>  still I do have some problems... the assignment of values to arrays
>  in arrays works, but I gave the arrays in the array names:
> 
>  @array = \(@names, @school, @othercrap);
> 
>  so $array[2][3] would be some entry in @school...
>  ok, but is there a way of getting the name of @school by supplying
>  the number only?  like $array[2] <<----! (school)
> 
>  any ideas? (thanks in advance)
> 
> 
> 
> 
> --
> mfg
>  Alex                          mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to