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


in reply to Re: Left padding a number with zeros: PerlFaq method didn't work for me.
in thread Left padding a number with zeros: PerlFaq method didn't work for me.

Ok...ever have one of those days when you start to lose track of what you did? Well, this thread may prove that! It's been a LONG day, and last nite was also, trying to get a new utility configured to work on my sys. Thus, in looking for the code that didn't work (backup file), I realized that there was a tilde (in addition to equals, so =~) in there that I must have removed VERY late last nite! So that may well explain it...

But I do believe/think I tried it the first line way also with same failure. FAQ says "you can use an integer in place of $pad_len if you know the pad length in advance."
$Wmmyy = sprintf("%0${4}d", $FORM{'SRmmyy'});<br> $Wmmyy = sprintf("%0*d", 4, $FORM{'SRmmyy'});

I had the problem about 2am last nite and remembered just now that I was going to ask about it...so I posted while doing some other tasks...oops, ok?