>
> @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 don't know how) and I give
> them all a
> string like:
>
> $website_76 = 1; # position 1
> $website_87 = 2; # position 2
>
I am not exactly sure what you mean. but you can write a max function, then
attach a string to that interger value. or you can sort them first then pop
or shift them off one by one..
@array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
$rv = max(\@array);
# print "$rv" . $somestring . "\n";
sub max {
my($num) = @_;
my ($max) = shift @$num;
foreach $i (@$num) {
$max = $i if $max < $i;
}
return($max);
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]