package human; =head1 NAME humanreadable - perl module to make some things easier to read for humans. =head1 SYNOPSIS use human qw(&humandate) $date = &humandate(); # Current date. $date = &humandate(time()) # Specified time. =head1 DESCRIPTION Humans like dates like May 27th, 1954. =head1 AUTHOR John Halleck =head1 COPYRIGHT (C) Copyright 2000 by John Halleck. =cut use vars qw ($VERSION @ISA @EXPORT_OK); @ISA = qw (Exporter); @EXPORT_OK = qw(&humandate); $VERSION = 1.0; sub humandate { my $when = shift; $when = $^T if !defined $when; my ($day, $month, $year) = (localtime($when)) [3,4,5]; my @months = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); my @dates = ( '1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th', '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st' ); my $today = $months[$month] . ' ' . $dates[$day-1] . ', ' . ($year+1900); return $today; } 1;