I'm glad it works for you, but I should point out a few flaws in the solution I proposed:
- The "and" will prevent the value from being returned, if no substitution occurs.
- 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