#!/usr/bin/perl -w use strict; use DateTime; my $date = [ qw{ 06/30/96 08/07/97 09/05/97 12/11/97 03/26/98 07/17/98 10/23/98 11/12/98 01/14/99 04/10/99 05/27/99 02/10/00 03/10/00 03/15/00 03/15/00 03/30/00 06/15/00 07/13/00 08/03/00 09/07/00 09/30/00 12/10/00 01/25/01 02/27/01 } ]; my $oldest = dt( shift @$date ); printf "Diff in month between %s and \n", $oldest->dmy('/'); printf "%s : %s\n", $_, dt($_)->subtract_datetime($oldest)->in_units('months') for @$date; sub dt { my ( $month, $day, $year ) = split /\//, shift; $year = ( $year > 90 ? '19' : '20' ) . $year; DateTime->new( year => $year, month => $month, day => $day ); }