Welcome to the worlds of Perl and Perlmonks! (Please read Writeup Formatting Tips to learn how to add code tags to your posts.)
The requirement for disallowing use of printf and sprintf, combined with the nature of the problem itself, make this sound a bit like homework (please forgive me if I am wrong). In general monks don't mind helping with homework as long as you show us you've made a good faith attempt at solving the problem and are very specific about what you need help on. You're part of the way there, so I'll give you a little nudge without explicitly stating one (of the many) ways to do this.
Think about how people deal with calculating dollars and cents without having to round the cent values. I'm sure a SuperSearch would come up with something.
Secondly, I don't think your use of int is doing what you expect (currently you're calculating the integer value of 9). Try moving it to a different place in the formula. It may be easier to see what is going on if you break the formula up into separate parts and print the value of each intermediate step.
Finally, use strict; use warnings; will help tremendously as you learn the syntax of the language. They are your friend.
Best of luck, and welcome to Perlmonks! Please post a reply if you remain stuck.
Update: Gah! derby beat me to it.
In reply to Re: perl newbie question
by bobf
in thread perl newbie question
by john83reuben
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |