[prog] Little Perl Question

Malke Routh malke at attbi.com
Mon Sep 30 05:55:46 EST 2002


Hi - I'm teaching myself Perl (my first programming language!), so am a
rank beginner. I'm writing a little Perl program based on the math quiz
in "Elements of Programming with Perl".  Basically, my quiz runs through
simple addition, multiplication, subtraction, and division using random
numbers from 0-12 inclusive.  I've done alright with addition and
multiplication, but in subtraction, I don't want negative numbers.  If
I'm doing something like:

$first_number - $second_number

how do I specify that the first number always has to be bigger than the
second number?

I'll be able to get through division because the author of the book has
the division code in there already.

Thanks,

Malke
-- 
Elephant Boy Computers
www.elephantboycomputers.com
"Don't Panic!"




More information about the Programming mailing list