I made the following changes....<br><br>
<div class="gmail_quote">On Wed, Apr 2, 2008 at 3:10 PM, Emmanuel Mejias &lt;<a href="mailto:emmanuel.mejias@gmail.com">emmanuel.mejias@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>My instructor has asked me to use the pop, shift, and push functions to write a script that sufficiently &quot;shuffles&quot; a simulated deck of cards before printing the top five cards. I haven&#39;t quite got it down, but I was wondering, did I need to add the highlighted&nbsp;line&nbsp;in my code or something along those lines to indicate $element = pop (@deck) or is that what I&#39;m&nbsp;using&nbsp;&quot;push&quot;&nbsp;for? Now it does pop A H to the bottom of the deck. So what exactly is&nbsp;it that I&#39;m doing wrong?</div>

<div>&nbsp;</div>
<div>#!/usr/bin/perl -w</div>
<div>@deck = (&quot;A H&quot;,&quot;2 H&quot;,&quot;3 H&quot;,&quot;4 H&quot;,&quot;5 H&quot;,&quot;6 H&quot;,&quot;7 H&quot;,&quot;8 H&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;9 H&quot;,&quot;10 H&quot;,&quot;J H&quot;,&quot;Q H&quot;,&quot;K H&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;A D&quot;,&quot;2 D&quot;,&quot;3 D&quot;,&quot;4 D&quot;,&quot;5 D&quot;,&quot;6 D&quot;,&quot;7 D&quot;,&quot;8 D&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;9 D&quot;,&quot;10 D&quot;,&quot;J D&quot;,&quot;Q D&quot;,&quot;K D&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;A C&quot;,&quot;2 C&quot;,&quot;3 C&quot;,&quot;4 C&quot;,&quot;5 C&quot;,&quot;6 C&quot;,&quot;7 C&quot;,&quot;8 C&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;9 C&quot;,&quot;10 C&quot;,&quot;J C&quot;,&quot;Q C&quot;,&quot;K C&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;A S&quot;,&quot;2 S&quot;,&quot;3 S&quot;,&quot;4 S&quot;,&quot;5 S&quot;,&quot;6 S&quot;,&quot;7 S&quot;,&quot;8 S&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;9 S&quot;,&quot;10 S&quot;,&quot;J S&quot;,&quot;Q S&quot;,&quot;K S&quot;);</div>

<div>foreach my $card (@deck){</div></blockquote>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chomp (@mydeck);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push (@mydeck, pop(@mydeck));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push (@mydeck, shift(@mydeck));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;Cards: $card\n&quot;<br>}<br></div></div><br>