#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Appointment; my $x = Appointment->new(Month=>45, Day => 1); print "Month: ",$x->Month,"\n"; print Dumper $x; __END__ Prints: Month: 45 $VAR1 = bless( { 'Day' => 1, 'Month' => 45, 'Freq' => 'OneTime' }, 'Appointment' ); #### #!/usr/bin/perl #file: Appointment.pm package Appointment; use Moose; # automatically turns on strict and warnings my @freq_valid = (qw/OneTime Daily Monthly Quarterly/); has 'Month' => ( is => 'ro', isa => 'Int', required => 1, ); has 'Day' => ( is => 'ro', isa => 'Int', required => 1, ); has 'Freq' => ( is => 'ro', isa => 'Str', default => 'OneTime', ); 1;