$int = 5; printf "%0" . $int . "i", $myInt; #### use constant COLWIDTH => 5; $int = 5; printf "%0" . COLWIDTH . "i", $myInt;