How do I use sprintf to zero fill to a variable length in Perl?
- by Michael Shnitzer
I want to use perl's sprintf to zerofill a variable.
sprintf("%08d", $var);
but I want the dynamically determine how many digits to zero fill.
How do I replace the "8" in sprintf("%08d", $var) with a variable called $zerofill.
Thanks.