Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Finding the max()/min()

by pg (Canon)
on Nov 11, 2004 at 02:52 UTC ( [id://406889]=note: print w/replies, xml ) Need Help??


in reply to Re: Finding the max()/min()
in thread Finding the max()/min()

Update:

Per elusion's update, he has already fixed both solutions.

============

Your solution one does not compile.

Your solution two does not work, and it does not print anything:

use strict; use warnings; print max(1.23,2.6,55.1,4,5); sub max { my ($max, $next, @vars) = @_; return if not $next; return max( $max > $next ? $max : $next, @vars ); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://406889]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found