You can assign a list of results to a list of variables all at once.
printf or
sprintf are the tools of choice when you have to pad stuff for presentation on screen. Try to avoid superfluous temporary variables wherever possible.
#!/usr/bin/perl -w
use strict;
print "Please enter your name: ";
chomp(my $name = <STDIN>);
my @greeting = ("morning", "afternoon", "evening");
my @days = qw/ Sunday Monday Tuesday Wednesday Thursday Friday Saturda
+y /;
my @months = qw/ January February March April May June July August Sep
+tember October November December /;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
$year += 1900;
my $greeting =
$hour < 12 ? 0 :
$hour < 17 ? 1 :
2;
print <<"EOT", $hour, $min;
Good $greeting[$greeting], $name.
Today is $days[$day], $months[$mon] $mday, $year.
The time is now %02d:%02d.
EOT
(Untested, might have a typo or two.)
Makeshifts last the longest.