summaryrefslogtreecommitdiffstats
path: root/fizzbuzz.pl
blob: df08f1dbac86245e53566094def5add2022423f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
#License: Public domain
use strict;
use warnings;
#use Perl::Critic;

for (1 .. $ARGV[0] // 100)
	{
	my $x;
	if ( !($_ % 3) )	{ $x .= 'Fizz'	}
	if ( !($_ % 5) )	{ $x .= 'Buzz'	}
	if ( !$x )		{ $x = $_	}

	printf "$x\n";
	}