in reply to Re^2: Find the biggest number from three numbers
in thread Find the biggest number from three numbers

Heh. The motto of Perl is 'TMTOWTDI' - "There's More Than One Way To Do It". If you had asked to see different ways that people could implement that problem, you would have seen an amazing variety of ways to do it; in my experience, our fellow monks here are endlessly inventive. Here's a somewhat amusing one, off the top of my head:

#!/usr/bin/perl -l use warnings; use strict; my @x; print "Please enter one number per line (empty line ends input):"; while (<STDIN>){ last if /^$/; push @x, $_; } print "The biggest number is ", (sort {$b<=>$a} @x)[0], "@x" =~ /^([-0-9]+)\s+(?:\1\s+)*$/ && "All numbers are the same";

(Now don't let that distract you. "Learning Perl" is an excellent start for a Perl novice, so go study. :)


-- 
Education is not the filling of a pail, but the lighting of a fire.
 -- W. B. Yeats