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
|
---|
In Section
Seekers of Perl Wisdom