in reply to Formatting date strings (was: date +%Y%m%d)
It can also be done in one line, although that does not necessarily improve the readability ;-) printf "%04d%02d%02d", sub{$_[0]+1900,$_[1]+1,$_[2]}->((localtime)[5,4,3]);
-- Hofmator