in reply to Re: Re: Re: Regex on array elements during push
in thread Regex on array elements during push

I'm glad it works for you, but I should point out a few flaws in the solution I proposed:
  1. The "and" will prevent the value from being returned, if no substitution occurs.
  2. My replacing of "grep" with an "if" within the map causes blank values to be pushed when the /\S/ doesn't match
I should have just fixed the problem I saw, instead of trying to be clever.
push @array, map { $_->[1] =~ s/[\s?,]//g; $_->[1]; } grep { $_->[0] =~ /\S/ } @rows;

The PerlMonk tr/// Advocate