sub new_car { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { color => "bay", legs => 4, owner => undef, @_, # Override previous attributes }; return bless $self, $class;
1. Is the variable "self" a hash?
2. I need a mix data types. Pair type data (like I have currently) and a few arrays as well (like store the IDs under each color}. Is it possible to add array type data to a class?
If you guys can point me to a good resource to read, that would also be helpful.
Thanks in advance
In reply to arrays in classes by perl_noob_101
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |