(view source code of week.pl as plain text)
#! perl
# Week.pl, Version 2.00
# Display week number using Perl
# Written by Rob van der Woude
# http://www.robvanderwoude.com
# Parse time string
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
# Calculate number of full weeks this year
$week = int( ( $yday + 1 - $wday ) / 7 );
# Add 1 if today isn't Saturday
if ($wday < 6) {
$week = $week + 1
}
# Display the result
print "Week $week\n";
page last modified: 2024-04-16; loaded in 0.0057 seconds