in reply to Acessing an array element in a hash

Missing Lines:
my %key_hash= %{$VAR1}; $key = 'response_1.3.6.1.2.1.2.2.1.12.27'; $oid = '1.3.6.1.2.1.2.2.1.12.27';

And now the code which should give you '1'
print $key_hash{$key}{$oid}[0]->[1];
Possible Error Detection:
$key_hash{$key}{$oid}[0] contains a single reference to an Array. So your code
print "@{$key_hash{$key}{$oid}[0]}\n";
dereference it and prints the entire array. Above suggested code just prints '1' as the 2nd element of that dereferenced array'.

artist

Replies are listed 'Best First'.
Re: Re: Acessing an array element in a hash
by Anonymous Monk on Mar 26, 2003 at 15:38 UTC
    Thanks guys,
    A simple mistake as always, and yes Mr_Muskrat I should and will be opening an account.