Thanks for the quick replies guys: sprintf "%03d", $num Did the trick, I need to study that a bit more to I think.
Thanks Dan > Howdy all, > > I know I'm being a puts but I can't for the life of me get > sprintf to do my bidding. > > What I'm tryng to do is take a number, say 5 or 10 and make > them three digits long with > Zeros on the left: > > IE > 5 would become 005 > And 10 would become 010 > > my $five = 5; > my $ten = 10; > > $five = sprintf(???, $five); > $ten = sprintf(???, $ten); > > print $five; > print "\n"; > print $ten; > > Should do: > 005 > 010 > > Help! I'm stupid today! > > TIA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]