Create a gist now

Instantly share code, notes, and snippets.

I wrote FizzBuzz in Perl
#!/usr/bin/env perl
use strict;
use warnings;
for my $str (1..30) {
if ($str % 3 == 0 && $str % 5 ==0) {
print "fizzbuzz\n";
} elsif ($str % 3 == 0) {
print "fizz\n";
} elsif ($str % 5 == 0) {
print "buzz\n";
} else {
print "$str\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment