in reply to printf with variable display width
If you're accepting $a from an untrusted source — aren't they all? — don't forget to validate it.
Don't use $a and $b as general purpose variables. They are special and reserved for sort callbacks.