There are probably people here who can give a better answer than me. There are *certainly* people on the PDL mailing list who can provide a better answer than I can.
in reply to Access element of a piddle
As a quick stab, you could try at():
but I don't know if that's the best option.
pdl> help at
Returns a single value inside a piddle as perl scalar.
$z = at($piddle, @position); $z=$piddle->at(@position);
@position is a coordinate list, of size equal to the number of
dimensions in the piddle. Occasionally useful in a general context
quite useful too inside PDL internals.
pdl> $x = sequence 3,4
pdl> p $x->at(1,2)
at converts any bad values into the string 'BAD'.
# line 3108 "Basic/Core/Core.pm.PL (i.e. PDL::Core.pm)"