Make KeysOnArray and ValuesOnArray work on 5.8 and 5.10 [RT#84728]