use strict; use warnings; my $tota11; for my $num (1818..1818){ my $tota11 = &spl($num); print "$num == 9\n" if ($tota11 == 9); } sub spl{ my ($num1) =@_; #we can still have inline comments as well. my $total = 0; $total = $total + $_ for (split '', $num1);#here $total is the #sum of all the digits of $num1 my $len = length ($total); return $total if ($len == 1); &spl($total) if ($len != 1); }