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

Re: getting the highest value in a simpler way

by tmoertel (Chaplain)
on Nov 10, 2004 at 16:21 UTC ( #406707=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        sub make_max_finder {
            my $max;
    ...
                $max;
            }
        }
    
  2. or download this
        my $max_finder = make_max_finder();
    
  3. or download this
        $max_finder->(0);
        print $max_finder->();    # 0
        print $max_finder->(-1);  # 0
        print $max_finder->(2);   # 2
    
  4. or download this
        print $max_finder->(-1, 3, 0);  # 3
        print $max_finder->(-1, 0, 1);  # 3
    
  5. or download this
        my $max_finder = make_max_finder();
    
    ...
        }
    
        $max_finder->();  # retrieve maximum
    
  6. or download this
        my $max_value = make_max_finder()->(@values);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2015-07-02 06:02 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 (29 votes), past polls