Not to completely miss the point, but you really should be using sprintf to do that:

$const{pidwithzeros} = sprintf "%010d", $const{pid};

In reply to Re: Re: You need more coffee when... by revdiablo
in thread You need more coffee when... by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":