And here's my OO version of your (abbreviated) module:
package Movie;
use strict;
use warnings FATAL => qw( all );
use Lingua::EN::Inflect qw(A PL_N NUM NUMWORDS inflect);
my $current_year = (localtime())[5] + 1900;
sub title { $_[0]->{'title'} }
# returns the start year of a movie
sub start_year { $_[0]->{'start year'} }
# returns a numeric end year of a movie for comparisons
sub end_year {
my $self = shift;
$self->{'end year'} or return $self->{'start year'};
$self->{'end year'} eq 'tbd' and return $current_year;
$self->{'end year'}
}
# returns a string with the run time of a television series.
sub run_time {
my $self = shift;
$self->{'media'} eq 'tv' or return();
$self->{'end year'} eq 'tbd' and return "which is still running";
my $sy = $self->start_year;
my $ey = $self->end_year;
$ey == $sy and return "which ran for less than a year";
my $run_time = $ey - $sy;
inflect("which ran for NUMWORDS($run_time) PL_N(year,$run_time)");
}
# returns the media type of a movie
sub media {
my $self = shift;
$self->{'media'} eq 'tv' ? 'television series' : $self->{'media'}
}
# returns what the movie is based on and by who or what
sub basis {
my $self = shift;
$self->{'based on'} or return();
qq(based on the $self->{'based on'} by $self->{'company'})
}
# returns a string with nearly all the properties of a movie
sub movie_is {
my $self = shift;
A(join(' ', grep { defined $_ } $self->start_year, $self->media, $
+self->basis, $self->run_time )).'.';
}
1;
Notice that I deleted the stuff about "insert %movies_data here!". Because this isn't where it should go. Instead, it should be placed in a "higher" level of the code -- whether that's the main program, or a containing module, or what.
This module is only for representing individual movie records. Hence the name "Movie", not "Movies".
Also, I renamed that last method (was "movie_is"), and I added a title method.
Also, I replaced your fatal warn() with a croak, so that I could get a full stack dump. You can revert that easily enough.