in reply to arrays in classes
Is the variable "self" a hash?
$self contains a reference to a hash.
Is it possible to add array type data to a class?
Certainly. Store a reference to an array in your hash reference, for example.
my $self = { color => "bay", legs => 4, owner => undef, aliases => [qw( Stumpy Blue Haze )], @_, };
If you guys can point me to a good resource to read, that would also be helpful.
I'm proud of the object chapters in my book Modern Perl. You can download it in several freely redistributable formats from that page.
|
|---|