use strict; my $i; my $roundup; my $mod; my $places; my $modifier; for $i () { chomp $i; $places = length $i; $modifier = 10; if ($places > 3) { $modifier = 100; } $mod = $i % $modifier; if ($mod) { $roundup = $i + ($modifier - $mod); print "$i rounded up is $roundup\n"; }else{ print "$i\n"; } } __DATA__ 0 2 9 11 20 21 112 1000 1325 1453 1999 10000 10001