|
Posted by metaperl@gmail.com on May 1, 2006, 11:24 am
Please log in for more thread options
nelson331 wrote:
> my $block1 = Block->new();
> $block1->number(1);
> $block1->steps(@stepArray); #this isn't working
The docs for Class::Struct
http://search.cpan.org/~jhi/perl-5.8.0/lib/Class/Struct.pm
do not show that type of usage. Only this usage:
With one or two arguments, the first argument is an index specifying
one element of the array; the second argument, if present, is assigned
to the array element. If the element type is '@', the accessor returns
the array element value. If the element type is '*@', a reference to
the array element is returned.
-- meaning, that you can only put in one element at a time.
Also:
1 - what are you resorting to objects for in this case anyway? The
standard Perl data structures look like they can handle this problem.
2 - Class::Accessor is much more popular for this sort of thing. I
prefer Class::Prototyped myself.
3 - You might find some more help on perlmonks.org for this type of
question.
Good luck
|