in reply to Regexp nightmare with CSV

If your data is the same (_always_) then you can use a specific regex to get the data out. Or, perhaps more appropriately, to modify your delimiters:

Case 1 - permanent regex:

for my $line (@lines_from_data_file) { my($idx,$fname,$sname,$loc,$time) = $line =~ /^(\d+),("[^"]+"),("[^"]+"),("[^"]+"),(.*)$/; }

Case 2 - one-liner to modify delimiters (in place)

perl -i.bak -ne "s/([\d\x22]),/$1.'|'/eg;print" datafile # for some reason I can't use single quotes for a # perl -e on Win32 so I have to use \x22 for "

Case 3 - just realised you can use the regex above (slight mod.) for your split.

@data = split /([\d"]+),/;
I still suggest that case 2 is your best option - you're just making more work for yourself if you don't.

"Argument is futile - you will be ignorralated!"