Could somebody tell me a Perl module with a function, that converts digits like this:
func( 1, 3 ) # returns 001
func( 23, 4 ) # returns 0023
func( 7, 2 ) # returns 07
Could somebody tell me a Perl module with a function, that converts digits like this:
func( 1, 3 ) # returns 001
func( 23, 4 ) # returns 0023
func( 7, 2 ) # returns 07
No module, just sprintf, though with the arguments in the other order and a suitable format argument:
sprintf( '%0*d', 3, 1 );
sprintf( '%0*d', 4, 23 );
sprintf( '%0*d', 2, 7 );