in reply to arrays of object in OO perl
Use use strict;! There's a major error in init.
As for the problem with getTheFirst, since it would be
$array[0]->getDNA()
if you were dealing with an array instead of a reference to an array, then it's
${$array_ref}[0]->getDNA()
when using an array ref. It can also be written as
$array_ref->[0]->getDNA()
So all together, we get
$this->{individual}->[0]->getDNA()</c>
See
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: arrays of object in OO perl
by IL_MARO (Initiate) on Nov 19, 2008 at 06:47 UTC | |
by ChOas (Curate) on Nov 19, 2008 at 07:50 UTC | |
by IL_MARO (Initiate) on Nov 19, 2008 at 07:57 UTC |