title: Moving and Altering First/Last Elements of Array in Perl
body: <p>I have an array containing the following words:</p>
  <pre><code>@animals = (
      &quot;cat&quot;,
      &quot;dog&quot;,
      &quot;mouse&quot;,
      &quot;elephant&quot;,
      &quot;giraffe&quot;
  );
  </code></pre>
  <p>How would I move element <code>0</code> to the end of the array? So now it will become:</p>
  <pre><code>@animals = (
      &quot;dog&quot;,
      &quot;mouse&quot;,
      &quot;elephant&quot;,
      &quot;giraffe&quot;,
      &quot;cat&quot;
  );
  </code></pre>
  <p>Is there a simple way using <code>shift</code>, <code>unshift</code>, <code>pop</code>, or <code>push</code>?</p>