I love you on the 1st of January 2011 I love you on the 2nd of January 2011 I love you on the 3rd of January 2011 ... I love you on the 31st of December 2011 #### # every day I love you use Modern::Perl; use Date::Calc::Iterator; use Lingua::EN::Inflect qw/ORD/; my @months = qw /January February March April May June July August September October November December/; my $start = $ARGV[0] ? parse_date( $ARGV[0] ) : [ (localtime)[5] + 1900, (localtime)[4] + 1, (localtime)[3] ]; my $end = $ARGV[1] ? parse_date( $ARGV[1] ) : [ $start->[0] + 1, $start->[1], $start->[2] ]; my $i = Date::Calc::Iterator->new( from => $start, to => $end ); my @result; my $day; push @result, join ' ', 'I love you on the', ORD( $day->[2] ), 'of', $months[ $day->[1] - 1 ], "$day->[0]." while $day = $i->next; pop @result unless $ARGV[1]; # drop the last one if the end is calculated by default say for @result; sub parse_date { my $date = shift; return undef unless $date; if ( $date =~ m/^(\d{2})[\/-]?(\d{2})[\/-]?(\d{4})$/ ) { return [ $3, $2, $1 + 0 ]; } else { return undef; } }