I would skip the duplication and the exporting of functions, something like this:
package Rand;
use strict;
use warnings;
sub _random {
my @values = @_;
return $values[rand @values];
}
sub day_part {
return _random(qw(morning evening afternoon night));
}
sub light {
return _random(qw(bright dark gloomy dazzling));
}
sub weather {
return _random(qw(stormy windy rainy calm));
}
sub tense {
return _random('was', 'is', 'will be');
}
1;
and the example code would look like this:
use strict;
use warnings;
use Rand;
my $random_day_part = Rand::day_part;
my $random_light = Rand::light;
my $random_weather = Rand::weather;
my $random_tense = Rand::tense;
print "It $random_tense a $random_light and $random_weather $random_da
+y_part."