Skip Menu |

This queue is for tickets about the Text-RecordParser CPAN distribution.

Report information
The Basics
Id: 34844
Status: resolved
Worked: 5 min
Priority: 0/
Queue: Text-RecordParser

People
Owner: kclark [...] cpan.org
Requestors: useEvil [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: v1.2.1
Fixed in: (no value)



Subject: cannot parse single or double quotes
I have a field that may contains single or double quotes. Text::RecordParser doesn't seem to like them. I'm not sure why it would die on those characters. 122810 shoxx.com 3 http://www.shoxx.com Oct 26 2005 12:00AM 1, rue de l'Etang, Contern, NA-DE, 5326, GERMANY, info@dretschler.com 23 753 48 16
On Thu Apr 10 17:04:46 2008, useEvil wrote: Show quoted text
> I have a field that may contains single or double quotes. > Text::RecordParser doesn't seem to > like them. I'm not sure why it would die on those characters. > > 122810 shoxx.com 3 http://www.shoxx.com Oct 26 2005 12:00AM 1, rue > de l'Etang, Contern, NA-DE, 5326, GERMANY, info@dretschler.com 23 753 > 48 16 >
The module seems to want you to escape single quotes in your source data: my @fields = map { defined $_ && $_ =~ s/\\'/'/g; $_ } ( Not sure if that is the best way to do things.
Since I've already decided to assume that the input has been fixed up by backslash-escaping the input for parse_line, I'm going to go ahead and escape single quotes that look like they haven't already. That should fix your problem, but I am open to suggestions that all of this could be handled better. Should I use a different line parser?