title: How to iterate through a Perl PDL piddle?
body: <p>The closest I got to was something like</p>
  
  <pre><code>use PDL;
  my $u = pdl [1,2,3,4];
  my $dim = 4;
  for(my $i=0; $i&lt;$dim; $i++)
  {
    print $u-&gt;flat-&gt;index($i), "\n";
  }
  </code></pre>
  
  <p>Also as I can convert <code>[1,2,3,4]</code> to piddle <code>$u</code>, can I get back a list (or a list of lists for a matrix) from <code>$u</code>?</p>