in reply to Multidimensional arrayrefs constructed from anonymous arrayrefs

You left the "@" out of your first line. And you should iterate through the element indices, rather than guessing that there will be 100 or fewer.

But your splice is removing an element from your top-level array if the corresponding element of an inner array has the forbidden value. I don't think that's sensible. Your commented line suggests you want to remove from the inner array:

for $d (@$values) { for $x (0..$#$d) { splice(@$d, $x, 1) if $d->[$x] eq 'UNKNOWN'; } }

The PerlMonk tr/// Advocate
  • Comment on Re: Multidimensional arrayrefs constructed from anonymous arrayrefs
  • Download Code