wrote:
> <> wrote in comp.lang.perl.misc:
> > Hi-
> >
> > trying to understand object oriented perl, and have been wondering
> > about passing arrays as parameters to object methods.
> >
> > If I pass a single array as a method parameter, it's fine, eg
> >
> > $object->raiseFlags(@flags);
> >
> > However, if I wanted to pass 2 arrays to an object method, I would have
> > to use references to objects, I think, since
>
> Not to objects, necessarily, but array refs are the standard way
> of handing in more than one array to a perl sub. Whether the sub
> is a method or not is irrelevant.
>
> > $object->raiseFlags(@flags, @specialOccasions);
> >
> > would append @specialOccasions to @flags to make a big jumbled list.
> >
> > Are there any issues to using references as method parameters when
> > using objects in perl?
>
> No.
>
> > Is there a better way to approach the problem?
>
> Other ways, yes. Better, no.
>
> Anno
thanks for the feedback, Anno.