#! Perl -w # clhypo.pl -- Hypotenuse command line version use strict; my($a, $b, $c) = @ARGV; if ($c eq "-") { $c = sqrt($a**2 + $b**2); print "C is $c"; } elsif ($b eq "-") { die "A cannot be greater than or equal to C!" if $a >= $c; $b = sqrt($c**2 - $a**2); print "B is $b"; } elsif ($a eq "-") { die "B cannot be greater than or equal to C!" if $b >= $c; $a = sqrt($c**2 - $b**2); print "A is $a"; }