loosecannon1
Programmer
Following is my compare loop that searches for two description keys that possess the same value.
Problem: If the evaluation is ever true I need to switch all values between the two AoH's. For example switch the values of $sortedPast[$i]{description} and $sortedPast[$z]{description} and so on for every key. How can I do this?
for $i(0..$#sortedPast) {
for $z(0..$#sortedPast) {
if ($i == $z) { $z++ }; # !compare same array
if ($sortedPast[$i]{description} eq $sortedPast[$z]{description}) {
# switch all values of $sortedPast[$i] and sortedPast[$z]
}
}
}
If my problem is unclear let me know.
loosecannon
Problem: If the evaluation is ever true I need to switch all values between the two AoH's. For example switch the values of $sortedPast[$i]{description} and $sortedPast[$z]{description} and so on for every key. How can I do this?
for $i(0..$#sortedPast) {
for $z(0..$#sortedPast) {
if ($i == $z) { $z++ }; # !compare same array
if ($sortedPast[$i]{description} eq $sortedPast[$z]{description}) {
# switch all values of $sortedPast[$i] and sortedPast[$z]
}
}
}
If my problem is unclear let me know.
loosecannon