Exchange hash values without temporary variable
<p>I have two hash values a couple of levels deep in a data structure that I would like to exchange and then switch back later. </p>

<p><code>$hashref-&gt;{$irrelevant}{$key1}</code> and <code>$hashref-&gt;{$irrelevant}{$key2}</code></p>

<p>Since they are such long names, <code>($a, $b) = ($b, $a)</code> would be way too long for a single line of code.</p>

<p>Is there a way to do this elegantly, or am I stuck taking up three lines by exchanging with a temporary variable?</p>