my @datekeys = ("seconds","minutes","hour","mday","month","year","wday","yday","isdst"); my %localtime; @localtime{@datekeys} = localtime( time ); printf "It now is %s:%s and the %d day of the week\n" ,$localtime{"hour"} ,$localtime{"minutes"} ,$localtime{"wday"} ;