Regular Expression

~s/^(\d+)$/("0"x($optimal_length-length$1)).$1/e;