Q:

how can i generate list of dates in perl?

I want to write a script that generates dates between now and the last year in perl.
Ex 
                <option value="01/02/2010">Feb 07</option>
                <option value="01/03/2010">Mar 07</option>
                <option value="01/04/2010">Apr 07</option>
                <option value="01/05/2010">May 07</option>
                <option value="01/06/2010">Jun 07</option>
                <option value="01/07/2010">Jul 07</option>
                <option value="01/08/2010">Aug 07</option>
                <option value="01/09/2010">Sep 07</option>
                <option value="01/10/2010">Oct 07</option>
                <option value="01/11/2010">Nov 07</option>
                <option value="01/12/2010">Dec 07</option

I have no idea how I can do it. I am doing it manually for now

A:

Adjust formatting and amount subtracted for taste.
#!/usr/bin/perl

use strict;
use warnings;
use DateTime;

my $now = DateTime->now;
my $start_of_last_year = DateTime->new( year => $now->year - 1 );
while ( $now > $start_of_last_year ) {
        print $now->ymd('/'), "\n";
        $now->subtract( days => 1 );
}

