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