in reply to Re: Splitting a line on just commas
in thread Splitting a line on just commas

@arr = split /(".+?")|,/, $s print @arr a b "hey,you" "str1, str2, str3" end

Replies are listed 'Best First'.
Re^3: Splitting a line on just commas
by ikegami (Patriarch) on Jun 14, 2010 at 17:27 UTC
    That doesn't work. It actually returns
    ( 'a', undef, 'b', undef, '', '"hey, you"', '', undef, '', '"str1, str2, str3"', '', undef, 'end', )

    Keep in mind the first arg of split is a separator.