use POSIX 'strftime'; sub get_CCYYMMDD { return strftime '%Y%m%d', $_[0]; }