Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: extracting the largest values

by Perl Mouse (Chaplain)
on Nov 22, 2005 at 11:26 UTC ( #510728=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($value > $largest_value) {
        ($largest_value, $second_value) = ($value, $largest_value);
    ...
    if ($value > $second_value) {
        $second_value = $value;
    }
    
  2. or download this
        ($largest_value, $second_value) = sort {$a <=> $b} $largest_value,
    + $second_value, $value;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2022-11-30 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?