in reply to Seeking the
sprintf is the baby that you want to use - you will be able to read about that more in the documentation. But as date things are a very common use I'll repeat an example:
use strict; use warnings; my ( $day, $month, $year ) = (localtime)[3,4,5]; my $date = sprintf "%.04d%.02d%.02d", $year + 1900, $month + 1, $day;
I'm sure this code has been shown thousands of time before
/J\
|
|---|