Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Efficiently finding values of an extremity

by Limbic~Region (Chancellor)
on Jul 20, 2005 at 18:01 UTC ( [id://476580]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @min_keys = sort { length($a) <=> length($b) || $a cmp $b } keys %$
    +hashref;
    my $min = length $min_keys[0];
    ...
    }
    # maxstr & random
    print join "\t", $min_keys[-1], $min_keys[ rand @min_keys ];
    
  2. or download this
    my @list = qw(zero one two three four five six seven eight nine ten el
    +even twelve);
    
    ...
        }
        return ($maxstr, (@min[0..$pos])[rand $pos]);
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found