#!/usr/bin/perl $a=13; $length=6; while (length($a)<$length) {$a="0$a";} print $a;