my($day, $month, $year)=(localtime)[3,4,5]; print "$day-".($month+1)."-".($year+1900)."\n"; # or use Time::localtime; $tm=localtime; my ($day,$month,$year)=($tm->mday,$tm->month,$tm->year);