programming-examples/perl/Datatype/Time of Day.pl

21 lines
583 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#! /usr/local/bin/perl
($sec, $min, $hr, $dayOfMonth, $month, $yr,$weekday, $dayOfYear, $dayLightStandardTime) = localtime(time);
if ( ($month == 11) && ($dayOfMonth == 23 || $dayOfMonth == 24) ){
print "Merry Christmas World \n";
}
else {
if ($hr > 18){
if ($hr < 21){
print "Good Evening World\n";
}else {
print "Good Night World\n";
}
}elsif ($hr > 12){
print "Good Afternoon World\n";
}elsif ($hr > 6) {
print "Good Morning World\n";
}else {
print "Go to BED already! \n";
}
}