Fernando Freire Baez (Medicare) wrote:
Hello,
I have an script that have to open and read a file all days in the morning.
The script is fine but I have a little doubt about the file name. The file
name is the day before the current day, so, for example: today is 11/14/2002
and the name of the fil
This will do it for you :-
use Time::Local;
$today = timelocal(localtime);
@yesterday = localtime($today - (24 * 60 * 60));
my ($mday,$mon,$year) = (@yesterday)[3..5];
$mon=++$mon;
if ($mon < 10){$mon="0$mon";}
if ($mday < 10){$mday="0$mday";}
$year=$year+1900;
$filename="$mday$mon$year";
prin