 <p>First of all, you should always put <code>use strict;</code> at the top of your program. That will catch numerous errors early.</p> <p>The last line in your <code>foreach</code> loop is the one that dereferences <code>$thingy</code> correctly. But since you've put <code>@{$thingy}</code> on the left-hand side of the <code>.</code> (string concatenation) operator, the array is in scalar context, and arrays in scalar context evaluate to their size. Just say:</p> <pre><code>print "@{$thingy}\n"; </code></pre> <p>to get the elements of <code>@$thingy</code> separated by spaces, or in general</p> <pre><code>print join('|', @{$thingy}), "\n"; </code></pre> <p>if you want to use another separator, like the vertical bar character. You can also just say</p> <pre><code>print @{$thingy}, "\n"; </code></pre> <p>to print the elements with no separator at all.</p>