Try making a numberLposition hashas you iterate through the array, add each number as
a key and the position in the array as the value. Then use sort($keys(%hash)) to
order them. I'm a newbie, also, so I'm not sure if sort has an optional parameter for
order, though. You'll have to explore th
Mystik Gotan said:
Careful with the crossposting. This has nothing to do with CGI, and I
don't suppose my post will even get to the yahoo list.
> I'm in search for a solution. Let's say I have this array:
>
> @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
>
> Now, how can I get the biggest intege
6, 5, 1, 0)
What do you want to do with this?
Aloha => Beau.
-Original Message-
From: Mystik Gotan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 3:10 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: How to get the biggest integers from an array?
ts.net
MSN: [EMAIL PROTECTED]
From: Geraint Jones <[EMAIL PROTECTED]>
To: "Mystik Gotan" <[EMAIL PROTECTED]>, [EMAIL PROTECTED],
[EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: How to get the biggest integers from an array?
Date: Tue, 10 Dec 2002 14:39:42 +
Use
Use the sort function:
print sort @array;
and for largest number first use:
print reverse sort @array;
For your particular problem:
@sorted_array = reverse sort @array;
foreach (@sorted_array)
{
# whatever you want to do with each number
Hiya,
I'm in search for a solution. Let's say I have this array:
@array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
Now, how can I get the biggest integers from this array and give them a
string with their place. Let's say I have a foreach loop where I checked all
the biggest integers (however, I do