P
Pradeep Patra
Hi all,
I am new to perl. While doing some sample programs I am getting a
issue as follows.
I have a HASH as follows
$VAR1 = [
{
'A-list' => [
{
'B-info' => [
{
'name' => 'd',
'time' => '0',
'virtual' => 'v1',
'f1' => '0'
}.
{
'name' => 'n2',
'time' => '0',
'virtual' => 'v1',
'f1' => '0'
}.
]
I want to search the line virtual="v1" from all the records in the
above hash and then in that record i want to check name is "d" and if
it is true return 1 else return 0. I am trying to do as follows for
testing whether the name returns "d" or not. But $name returns empty
string. Can anybody tell me what I am doing wrong for which i will
appreciate?
my $name = $VAR1{"A-list"}->{"B-info"}->[0]->{'name'};
my $name = $VAR1{"A-list"}->{"B-info"}->[0]->{"name"}; (Same results
$name returns empty string)
I am new to perl. While doing some sample programs I am getting a
issue as follows.
I have a HASH as follows
$VAR1 = [
{
'A-list' => [
{
'B-info' => [
{
'name' => 'd',
'time' => '0',
'virtual' => 'v1',
'f1' => '0'
}.
{
'name' => 'n2',
'time' => '0',
'virtual' => 'v1',
'f1' => '0'
}.
]
I want to search the line virtual="v1" from all the records in the
above hash and then in that record i want to check name is "d" and if
it is true return 1 else return 0. I am trying to do as follows for
testing whether the name returns "d" or not. But $name returns empty
string. Can anybody tell me what I am doing wrong for which i will
appreciate?
my $name = $VAR1{"A-list"}->{"B-info"}->[0]->{'name'};
my $name = $VAR1{"A-list"}->{"B-info"}->[0]->{"name"}; (Same results
$name returns empty string)