#!/usr/bin/perl use strict; use warnings; use feature 'say'; # my_day.pl - predicts your day based on your mood use MyDay; my $mood = $ARGV[0] or die "no mood!"; my $day = MyDay->new; # construct a new object $day->mood( $mood ); # set the value of the object attribute # based on this script's argument my $prediction = $day->predict; # call the predict() method on the object, # which contains your mood stored within it. if ( $prediction ) { say 'Your day will ' . $prediction . ', do not worry.'; } else { say 'Cannot read your mood so unable to predict your day.'; } __END__