http://qs321.pair.com?node_id=58188

SparkeyG has asked for the wisdom of the Perl Monks concerning the following question:

In the following snippit, I wish to take the second match, $2, and pass it to a sub that will create a DB table. The problem is that w/in the sub, the variable shows the entire line matched.
if ( /(^\s?>)(.*)$/ ) { print "$2\n"; &createTable($2); next; } sub createTable { print $_; }
The output I am getting is:
apples >apples trees >trees etc.. >etc..
The expected output would be, I thought...
apples apples trees trees etc.. etc..
JAPP SparkeyG