- or download this
Stored Zoo data:
Llama - Feet:4 - Color:Tan
Camel - Feet:4 - Humps:2
- or download this
#[pseudocode - will not compile]
foreach $line (<FILE>) {
...
my $newanimal = new Animal($name, $animalstats);
push (@allanimals, $newanimal);
}
- or download this
__DATA__
Llamas:
...
$animalstats);
}
}
- or download this
package Animal;
sub new (
...
return new Animal::Generic($name, $data);
}
}
- or download this
foreach $type (keys $allanimals) {
my $num_of_animals = $allanimals{$type}->count_collection(); # A met
+hod in Animal::Colelction
...
$animal->feed();
}
}