in reply to Help!!!! POOP is confusing me!
The initialization of $self is wrong as well. You probably wanted to write:
my $self = { farmName => '', farmMammals => [], farmBirds => [] }
Usage of => improves readability and allows you to omit apostrophes on LHS
$ in $farmName makes no sense - only if you wanted a hash item indexed by the value of variable $farmName
() is an empty list, inside a list it's the same as if it weren't there at all. [] is an empty arrayref, that's what you need.
|
---|