i have written only the part that is related to the format of my date. sorry, but i am new to perl.
#!/usr/bin/perl
use strict;
use warnings;
my ( $sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst ) = localtime(time()- 24*60*60 );
$year += 1900;
$mon += 1;
if( $mon < 9 ){
$mon = "0"...