in reply to subtracting numbers

This is a problem of logic, rather than Perl. The number 55 matches all three of your >= criteria, so you will of course get all 3 outputs. If you only want one output for each then consider reversing the order of your tests and using elsif for the other blocks. eg:

if ($number >= 50 ) { # ... } elsif ($number >= 20) { # ... } elsif ($number >= 10) { # ... }

This way you will get, at most, one line of output for any value of $number.


🦛