I think I sent my entry directly to Michael . . . my @stack; unshift @stack, $a; unshift @stack, $b; $a = shift @stack; $b = shift @stack; Note that this will work with any scalar, not just integers. Note that it also uses temporary storage, but not a temporary scalar. So far I think I like the approach using ^= best.