expression?
Yes you can, but not in the way you probably tried first. It is not possible to use a piddle directly in a conditional expression since this is usually poorly defined. Instead PDL has two very useful func- tions: ” any” and ” all” . Use these to test if any or all elements in a piddle fulfils some criterion: perldl> $a=pdl ( 1, -2, 3); perldl> print ’$a has at least one element < 0’ if (any $a < 0); $a has at least one element < 0 perldl> print ’$a is not positive definite’ unless (all $a > 0); $a is not positive definite it is really very simple: Do not use logial operators on multi-element piddles since that really doesn’t make sense, instead write the example as: $mask = which($piddle > 1 & $piddle < 2); which works correctly.