in reply to A better way to split CSV files with quoted strings that may contain commas?

UPDATE from rkaminski: I really appreciate all the replies, Wow! The vendor does not use full CSV format, or CSV header records, and hasn't for 20 years, and doesn't plan to, so all of the module techniques mentioned, while certainly the correct way to go in true CSV situations, do not seem to apply to this admittedly strange special case. I did learn a lot about proper CSV techniques, and for that I thank you all. However, the magical regular expression idea from the FAQ, (modified slightly to use ' instead of ") worked great. Here is the updated code, which works well enough, although I suspect that there is a more perlish way to do it. I was also really impressed by the contributor (ruzam) who modified it even farther to deal with ', " and extra spaces, which surpassed my needs but was excellent for folks who have even odder input than I do!
@inline=(); push(@inline, $+) while $pre_inline =~ m{'([^\'\\]*(?:\\.[^\'\\]*) +*)',? | ([^,]+),?| , }gx; push(@inline, undef) if substr($pre_inline,-1,1) eq ','; $semi_thirty_char_node_key = $inline[0]; $mem_size = $inline[4]; $spec = $inline[5]; $num_proc = $inline[6]; $model = $inline[10]; $os = $inline[11]; $alias = $inline[14]; $perf_rate_type = $inline[15]; $node_mode = $inline[18]; $num_logical_processors = $inline[19];
The input data was:
;pdbdevd1 Olx8jQCKrnQvrA0,'IBM eServer p5 595 1900MH',pdbdevd1,I +BM_P5_595_1900,4096.000000,394.848511,27,,,,IBM_p5_595_1900,AIX,,,pdb +devd1,SPECINTRATE2000,EST,'IBM,02028C8AD',LOGICAL,2,DLPAR,SMT
So, instead of using the split with undefs I resorted to indexing off of $inline, but it worked! granted, timtowtdi, but if you have a more elegant way, please comment. Thanks to all who helped so far! I will try to help others in the future too!