Skip to content

Instantly share code, notes, and snippets.

@mikeda
Created April 3, 2015 12:48
Show Gist options
  • Save mikeda/3985996d1262b7571155 to your computer and use it in GitHub Desktop.
Save mikeda/3985996d1262b7571155 to your computer and use it in GitHub Desktop.
fizzbuzz
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $num = 100;
for my $i (
1..$num
)
{
if ( $i % 15 == 0 )
{
print "FizzBuzz";
}
elsif( $i % 3 == 0 )
{
print "Fizz";
}
elsif( $i % 5 == 0 )
{
print "Buzz";
}
else
{
print $i;
}
print "\n";
}
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment