http://www.perlmonks.org?node_id=106318


in reply to Can I pad a number with leading spaces rather than leading 0's

Keep reading about perlfunc:sprintf. It seems you want a format like so:
sprintf("\$%6.2f\n",$price);