in reply to Dividing and format
printf / sprintf is the obvious way, and given they are builtin functions, I see no reason not to use them.
Want to give us a slightly fuller description of the problem and reasons for the restriction before this gets branded as homework? ;)
In Section
Seekers of Perl Wisdom