P
Pradeep Patra
Hi,
I am tryting out a perl program and I am having issue in
dereferencing the arrays or arrayreferences.
I am referring to the "growing your own" from perldoc perllol.
Regards
Pradeep
my $array_refs;
my @array;
for ($i=0;$i < 3; $i++)
{
@array = func1($i)
push(@{$array_refs},\@array);
}
for my $s (@{$array_refs})
{
my $c = $s->func2(); # This function works on actual arrays
}
I am getting an error "cannot call func2() on unblessed reference".
When I tried with below it works but I am getting the last array
values(from for loop i <3 as above) which I dont want. I tried with
@@{$array_refs} but i am getting some error"Global symbol
@@{$array_refs} in package". Can anybody please help me to figure out
what i am doing wrong?
Works:
=====
for my $s (@array){
{
my $c = $s->func2();
}
I am tryting out a perl program and I am having issue in
dereferencing the arrays or arrayreferences.
I am referring to the "growing your own" from perldoc perllol.
Regards
Pradeep
my $array_refs;
my @array;
for ($i=0;$i < 3; $i++)
{
@array = func1($i)
push(@{$array_refs},\@array);
}
for my $s (@{$array_refs})
{
my $c = $s->func2(); # This function works on actual arrays
}
I am getting an error "cannot call func2() on unblessed reference".
When I tried with below it works but I am getting the last array
values(from for loop i <3 as above) which I dont want. I tried with
@@{$array_refs} but i am getting some error"Global symbol
@@{$array_refs} in package". Can anybody please help me to figure out
what i am doing wrong?
Works:
=====
for my $s (@array){
{
my $c = $s->func2();
}