http://qs321.pair.com?node_id=430014


in reply to sprintf formatting doubt

You could just use the standard printf sintax, and write sprintf "%0*d",$dig,$inc; Here is an example:
perl -e '$a=150; $b=6; print sprintf "%0*d\n",$b,$a;' 000150