You can make your piddle into a Perl array using the 'list' command, if
you don't need to keep the 2d structure.
$a = sequence(3,3);
@l = $a->list;
Or you can make it into an array of arrays if you want to keep the 2d
structure.
@l = ( [ $a((0))->list ], [ $a((1))->list ], [ $a((2))->list ] );
print $l[2][0]; # prints '2'.
If it's too long to write out by hand, you can probably devise a loop
with a 'push' call inside.
Derek
Hugh Sasse wrote:
> When I get data into a PDL and manipulate it, I can print it
> to the screen but can't dump it with YAML in a form another
> YAML reader (Python, Ruby, ??) can work with. Is there a
> conventional way to get a 2D array back out of a PDL?
> I've done the usual web searching, prodded the internal help
> {?, ??} in all the ways I can think of, but to no avail so far.
>
> I've been away from Perl for several years, so I'm having to
> re-learn more than I'd care to admit :-)
>
> Thank you,
> Hugh
>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl