[EMAIL PROTECTED] writes:

> On Thu, Mar 28, 2002 at 12:16:20AM +0000, Jonathan E. Paton wrote:
> > 2. ...make it work in a more/less obfuscated
> >       way employing a minimum amount of regexs
> Less obfuscated, and a minimum amount of regexes:
> 
>     my $min = my $max = shift @array;
>     map {$max = $_ if $_ > $max;
>          $min = $_ if $_ < $min} @array;

I liked the first thing I came up with, which I suppose is at least
simple to type (and no less easy to read for me:

        my ($min,$max) = (sort @array)[0,-1];

Of course this loses if @array is large, or contains many identical
elements.  But it was Fun.
-- 
||----|---|------------|--|-------|------|-----------|-#---|-|--|------||
| ``Take a stress pill and think things over.''        [EMAIL PROTECTED] |
| ``I'll break your kneecaps.''                                         |
||--|--------|--------------|----|-------------|------|---------|-----|-|

Reply via email to