in reply to sprintf vs. substr (for zero-padded values)

Why not use 1 + int(log($number)/log(10)) in place of length(), if you can be sure you're using positive integers? ;)

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: sprintf vs. substr (for zero-padded values)
by Theseus (Pilgrim) on Jul 15, 2002 at 21:07 UTC
    Because math scares me. ;)