my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); # use a slice my ($year, $mon, $mday) = (localtime())[5,4,3];