in reply to Regex and @+
small remark ... you could have had an easier life by writing
print "\$1 is $1, \@- contains ", join(', ', @-), "\n"; print "\$2 is $2, \@+ contains ", join(', ', @+), "\n"; [download]
-- Hofmator