Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by pg (Canon)
on Nov 11, 2004 at 02:52 UTC ( #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 ); }


Comment on Re^2: Finding the max()/min()
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-07-28 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls