$bitmask = MoreMagic(@arr, @sel); [...other work...] @my_items = BetterMagic(@arr, $bitmask);