in reply to sprintf vs. substr (for zero-padded values)
Also, sprintf has functionality specifically intended for what we're using it for. It seems like we have to play with substr a little bit to get it to do what we need it to. If we have to use this code more than once, we'll either have to remember how we massaged substr and do it the exact same way again, or else put the substr solution in a subroutine of its own. Which is fine, but a little more effort.
To me anyway, the substr hoops are a little too large for me to jump through for a mere 2-3% gain in performance. But it could easily be that there are performance-critical applications for which the substr solution would be appropriate.
-- Mike
--
just,my${.02}
|
|---|