J
jidanni
$ perldoc -f sprintf
# Format number with up to 8 leading zeroes
$result = sprintf("%08d", $number);
OK, but how do I do
# Format number with up to 8 leading underscores
or any arbitrary character?
OK, I figured it out,
$ perl -wle '$_ = "00000050"; print; while (s/(^0*)0/$1_/) { }; print;'
00000050
______50
Geez.
# Format number with up to 8 leading zeroes
$result = sprintf("%08d", $number);
OK, but how do I do
# Format number with up to 8 leading underscores
or any arbitrary character?
OK, I figured it out,
$ perl -wle '$_ = "00000050"; print; while (s/(^0*)0/$1_/) { }; print;'
00000050
______50
Geez.