Ok, I'm a little confused about what you want, but I'll try to answer.

If you have a hash:

my %hash;

$hash{computername}{description}{'failed pings'} = 3;

then saying:

my @keys = keys %hash;
print "@keys";

will print:

computername

In other words, the keys function will not find keys in all references to
get the keys in a hash ref you have to say

my @keys = keys %{ $hash{computername} };

Hope that helps!
Tanton

----- Original Message -----
From: "Lorne Easton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 13, 2002 1:47 AM
Subject: Does anyone know anything about this..?


> I have data like this.
>
> Computername:Description:Failed Pings
>
> At present I am putting this data into seperate arrays
> and using an index to get it out in order. Not an
> extremely efficient way to do this and I will need to
> add more fields later and the like.
>
> I have considered using a hash, but if I,  say use the
> keys function, and am using a multidimensional hash
> (i.e $hash => computername => description => failed pings) it will, I
> assume, return all the values as keys, whereas I only want the first layer
> (I.E Computername)
> then I can use it to referance the data with known keynames.
>
> How would I do this? Could you please provide some
> example code for me? Thanks a lot in advance..
>
> Regards,
> Lorne
>
>
>
>
> --
> 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