in reply to sorting two arrays together

you could also use zip from List::MoreUtils to get your @c, if that helps.