my $num = ; chomp $num; my @array = (1..$num); for my $num1(@array){ if ($num1 % 3 == 0 && $num1 % 5 == 0) { print "FizzBuzz\n"; } if ($num1 % 3 == 0) { print "Fizz\n"; } if ($num1 % 5 == 0) { print "Buzz\n"; } if ($num1 % 3 != 0 && $num1 % 5 != 0){ print "$num1\n"; } }