Hi,
I'm trying to sort on array containing strings according to one containning values, eg:
$string[0] = "a";
$string[1] = "d";
$string[2] = "c";
$string[3] = "b";
$value[0] = 111;
$value[1] = 100;
$value[2] = 150;
$value[3] = 150;
So, I need an array that would return
$return[0] = "d";
$return[1] = "a";
$return[2] = "b";
$return[3] = "c";
I've tried using hashes, but since I sometimes get the same values (150 twice), my hash does not contain the same amount of entries as my $string array, eg:
$return{100}="d";
$return{111}="a";
$return{150}="b";
How can I resolve this?
Regards,
Thierry
I'm trying to sort on array containing strings according to one containning values, eg:
$string[0] = "a";
$string[1] = "d";
$string[2] = "c";
$string[3] = "b";
$value[0] = 111;
$value[1] = 100;
$value[2] = 150;
$value[3] = 150;
So, I need an array that would return
$return[0] = "d";
$return[1] = "a";
$return[2] = "b";
$return[3] = "c";
I've tried using hashes, but since I sometimes get the same values (150 twice), my hash does not contain the same amount of entries as my $string array, eg:
$return{100}="d";
$return{111}="a";
$return{150}="b";
How can I resolve this?
Regards,
Thierry