use strict; use warnings; use Date::Calc qw/Add_Delta_Days/; my ($mday,$mon,$year) = (localtime)[3..5]; my ($new_year,$new_month,$new_day) = Add_Delta_Days($year + 1900,$mon+1,$mday,-1); my $file_name = sprintf("%04d%02d%02d.dat", $new_year,$new_month,$new_day); print "Getting $file_name\n";