Yeah I am able to access the value but how to get the key ?
-Sunita
From: [email protected]
Date: Thu, 18 Jun 2015 14:46:10 +0530
Subject: Re: want to access single value in a hash
To: [email protected]
CC: [email protected]
Try this:-print
"$cmd_param_show->{'scsitrace_start_log_to_disk_true'}->{'param_val'}->{'log-to-disk'}\n";
-Akshay
On Thu, Jun 18, 2015 at 2:35 PM, Sunita Pradhan
<[email protected]> wrote:
I have following data structure :
my $cmd_param_show = {'scsitrace_start_log_to_disk_true' =>
{'param_val'=>{'log-to-disk' => 'true'},
'scsitrace_show' => {'log-to-disk' => 'true',
'enabled' => 'true',
'max-chain-size' => 16,
'max-file-size' => 0}}, 'scsitrace_stop' =>
{'param_val'=>{}, 'scsitrace_show' => {'log-to-disk' =>
'false', 'enabled' =>
'false', 'max-chain-size' => 16,
'max-file-size' => 0}},
'scsitrace_start' => {'param_val'=>{},
'scsitrace_show' => {'log-to-disk' => 'false',
'enabled' => 'true',
'max-chain-size' => 16,
'max-file-size' => 0}}, 'scsitrace_dump' =>
{'param_val'=>{}, 'scsitrace_show' => {'log-to-disk'
=> 'false', 'enabled' =>
'false', 'max-chain-size' => 16,
'max-file-size' => 0}},
};
How can I access single value from this hash without using loop ?
I tried to print like :print
"%{$cmd_param_show}->{'scsitrace_start_log_to_disk_true'}->{'param_val'}\n";
It failed .Please help me to get this.
ThanksSunita