package Monks::Data; use strict; use warnings; use parent 'Monks'; BEGIN { use Exporter(); our $VERSION = 20160808.00; our @ISA = qw(Exporter); } sub version { $Monks::Data::VERSION; } { my @fluffy; BEGIN { @fluffy = qw( Rabbits Minks Cats ); } sub is_fluffy { my $animal = shift; for (@fluffy) { return 'Yes' if $animal eq $_; } return 'No'; } } { my %textures; BEGIN { %textures = ( Rabbits => 'soft', Minks => 'supersoft', Cats => 'coarse', ); } sub get_texture { my $animal = shift; my $texture = 'unknown'; $texture = $textures{$animal} if exists $textures{$animal}; return $texture; } } 1; #### package Monks; use strict; use warnings; use Monks::Data; BEGIN { use Exporter; our $VERSION = 0.01; our @ISA = qw(Exporter); } sub version { $Monks::VERSION } sub new { my $class = shift; my $self = { @_ }; bless $self, $class; return $self; }; sub check_fluffy { return Monks::Data::is_fluffy($_[1]); } sub find_fur_texture { return Monks::Data::get_texture($_[1]); } 1;