#!/usr/bin/perl -w use strict; # the time functions follow the US sense of the calendar # in the US, the week starts on Sunday (index zero) # in Europe and other parts of the world, the week starts on Monday. # be aware of that if you are printing calendars, etc. my @dayNames = qw(Sunday Monday Tuesday Wednessday Thursday Friday Saturday); my ($wday) = (localtime(time))[6]; print "today's index number of the week is $wday: $dayNames[$wday]\n"; if ($wday >=1 and $wday <=5) { print "Today is normally a work day ", " holidays aren't taken into account\n"; } else { print "Hey, go home and sleep unless you get paid overtime\n"; } __END__ today's index number of the week is 1: Monday Today is normally a work day holidays aren't taken into account