Split automatically saves anything in parentheses
into the output list. This is so that a split
like this:
split /([,-])/, "1,10-20"
Will produce output like this:
"1", ",", "10", "-", "20"
I believe this is a mis-feature, but we get to
live with it. Since split only saves values that
get stored into
$1 and kin, you can
stop this behavior by not saving anything in those
special variables. Either omit the paranthesis
if unnecessary, or use the
(?: ... )
format, which doesn't save any values into
$1.
-Ted