in reply to printf & sprintf: variable number formats

There are several ways to do this. Here are two:

$int = 5; sprintf "%0${int}i", $myint; $int = 5; sprintf "%0*i", $int, $myint;

Replies are listed 'Best First'.
Re: Re: printf & sprintf: variable number formats
by Anonymous Monk on Jan 06, 2004 at 16:50 UTC
    wow,

    that was fast,
    thanks,
    Carl