A
Ami
Hi All,
I am quite new to perl and came accross one simple problem, which I
am not able to overcome. I have a record which consists of array. I
want to access array elements one by one but can't do it.
Code snippets is as follows:
$record = {
NAME => "Jason",
EMPNO => 132,
TITLE => "deputy peon",
AGE => 23,
SALARY => 37_000,
PALS => [ "Norbert", "Rhys", "Phineas"],
};
$byname{ $record->{NAME} } = $record;
push @{$byname{"Jason"}->{PALS}}, "Theodore";
@tt = ($byname{"Jason"}->{PALS});
for ($i=0;$i<1;$i++)
{
printf("PALS %s",$tt[$i]);
}
When I run this script, I always get the array reference e.g.
"ARRAY(0x24d5718)" . I want to print array list as
Norbert
Rhys
etc
Any help will be highly appreciated.
Thanks,
I am quite new to perl and came accross one simple problem, which I
am not able to overcome. I have a record which consists of array. I
want to access array elements one by one but can't do it.
Code snippets is as follows:
$record = {
NAME => "Jason",
EMPNO => 132,
TITLE => "deputy peon",
AGE => 23,
SALARY => 37_000,
PALS => [ "Norbert", "Rhys", "Phineas"],
};
$byname{ $record->{NAME} } = $record;
push @{$byname{"Jason"}->{PALS}}, "Theodore";
@tt = ($byname{"Jason"}->{PALS});
for ($i=0;$i<1;$i++)
{
printf("PALS %s",$tt[$i]);
}
When I run this script, I always get the array reference e.g.
"ARRAY(0x24d5718)" . I want to print array list as
Norbert
Rhys
etc
Any help will be highly appreciated.
Thanks,