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 ( #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 meditating upon the Monastery: (10)
As of 2014-10-20 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (92 votes), past polls