#!/usr/bin/perl use strict; my ($a, $b, $c); my $max = shift || die "Usage: pythag.pl \n"; for ($a=1; $a<$max; $a++) { for ($b=$a; $b<$max; $b++) { $c = sqrt(($a**2) + ($b**2)); unless ($c =~ /\./) { print "$a $b $c is a winner\n"; } } }