my @sorted = map { restore_from_cache } sort { by_cached_expensive } map { store_cache_expensive } @original;