Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: getting the highest value in a simpler way

by redEvo (Novice)
on Mar 17, 2011 at 20:59 UTC ( [id://893854]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $x = 0;
    foreach $y (@lots_of_values){
       $x = $y if $y > $x;
    }
    return $x;
    
  2. or download this
    my $x = 0;
    foreach $y (@lots_of_values){
       $x = [ $x => $y ] -> [ $x <= $y ];
    }
    return $x;
    

Log In?
Username:
Password:

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

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

    No recent polls found