print "ps before=$param_string\n"; my @ef = (extract_multiple($param_string, [ sub { extract_delimited($_[0]) }, sub { extract_bracketed($_[0]) }, sub { extract_variable($_[0]) }, qr/([^,]+)(.*)/, ], undef,1)); print "extracted=@ef\n\n"; Results: ps before=0.0, 0.0, 0.0, @inches, 0.0, 0.0, [0.0,0.0,'PI$pxtr19i'] extracted=0.0 ps before=0.0,0.0,0.0,@inches,0.0,0.0,[0.0,0.0,'PI$pxtr19i'] extracted=0.0 ps before= "TERMINAL_DRILL_SIZE", "", , @scale , , [0.034, 0.0] extracted="TERMINAL_DRILL_SIZE" "" If I remove the regexp match like this: my @ef = (extract_multiple($param_string, [ sub { extract_delimited($_[0]) }, sub { extract_bracketed($_[0]) }, sub { extract_variable($_[0]) }, #qr/([^,]+)(.*)/, ], undef,1)); then the results are: ps before=0.0, 0.0, 0.0, @inches, 0.0, 0.0, [0.0,0.0,'PI$pxtr19i'] extracted=@inches [0.0,0.0,'PI$pxtr19i'] ps before=0.0,0.0,0.0,@inches,0.0,0.0,[0.0,0.0,'PI$pxtr19i'] extracted=@inches [0.0,0.0,'PI$pxtr19i'] ps before= "TERMINAL_DRILL_SIZE", "", , @scale , , [0.034, 0.0] extracted="TERMINAL_DRILL_SIZE" "" @scale [0.034, 0.0]