carric has asked for the wisdom of the Perl Monks concerning the following question:
I want to know of what I WANT to do is possible...
I am doing an HTML::TableExtract, and getting back some strings that I would like to be able to "clean" before they get pushed into the aray.
...snip.... foreach $ts ($te->table_states) { foreach $row ($ts->rows) { push( @array, ($$row[1] =~ s/[?\s,]+//g) ) if $$row[0] =~ /\S+/; } print join("\n", @array); }
The output currently is:
2 2 2
So it is doing some scalar silliness.. Here is the output without the =~ s/[?\s,]+//g portion:
$44,000 $202,050 $246,050
Thanks again in advance. =)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex on array elements during push
by dragonchild (Archbishop) on Mar 22, 2004 at 19:12 UTC | |
by Roy Johnson (Monsignor) on Mar 22, 2004 at 20:46 UTC | |
by carric (Beadle) on Mar 22, 2004 at 21:05 UTC | |
by QM (Parson) on Mar 22, 2004 at 23:12 UTC | |
by Roy Johnson (Monsignor) on Mar 23, 2004 at 14:56 UTC | |
|
Re: Regex on array elements during push
by QM (Parson) on Mar 22, 2004 at 19:00 UTC | |
by carric (Beadle) on Mar 22, 2004 at 20:13 UTC |