E
en2guy
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
$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? Is there a better way to approach the problem?
Thanks
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
$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? Is there a better way to approach the problem?
Thanks