Ricardo SIGNES <mailto:[EMAIL PROTECTED]> wrote:

: * amr <[EMAIL PROTECTED]> [2005-05-07T19:45:56]
: : Thanks it was very useful.
: : Now, I need to do the same with sorted hash array. Can I?
: 
: "sorted hash array" is not clear, to me.  Do you mean you've done
:       this: sort keys %hash
: ?
: 

    my %foo = 'a' .. 'h';


: If so, just reverse the sort and use the first element,

    print + (reverse sort keys %foo )[0];


: or assign to an array and use element -1 as in previous mails.


    my @foo = sort keys %foo;
    print $foo[-1];

    Or:

    print + (sort keys %foo )[-1];


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to