speshak has asked for the wisdom of the Perl Monks concerning the following question:
Now when I try to run this I get:package Foo; ... sub doStuff { my $self = shift; foreach my $obj ($self->{objs}) { $obj->doSomethingElse(); } }
When I do a Data::Dumper on $obj I get the all of the array contents, and the loop only happens once. So the issue appears to be that I'm not iterating over what I think I am. Insight more than welcome. :)Can't call method "doSomethingElse" on unblessed reference..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Iterating over an array of objects, within an object?
by Crackers2 (Parson) on Dec 19, 2006 at 01:54 UTC | |
by GrandFather (Saint) on Dec 19, 2006 at 02:07 UTC | |
|
Re: Iterating over an array of objects, within an object?
by GrandFather (Saint) on Dec 19, 2006 at 01:45 UTC |