http://www.perlmonks.org?node_id=252823


in reply to Help with Numbers..Please

Numerical value of your number is 1 so the 'droping zeros' is correct behaviour. Try printf or sprintf for formating your outputs.
my $number = 1; printf '%06d', $number;
or get it back into $number variable

$number = sprintf('%06d', $number);