in reply to Re: Text::ParseWords parse_line containing quote
in thread Text::ParseWords parse_line containing quote

I want to use parse_line because of it's nifty parsing of embedded tokens. I am not looking for a split solution. I will be passing different delimiters, and strings into parse_line.

For this case, I want my output to be:

[it] [can] [do] [this] [but] [it] [can't] [do] [this]
instead of just
[it] [can] [do] [this]

Replies are listed 'Best First'.
Re: Re: Re: Text::ParseWords parse_line containing quote
by simonm (Vicar) on Jul 24, 2003 at 23:53 UTC

    The quote characters are hard-coded into the operation of parse_line. There's no argument or switch that lets you tell it that you want double-quotes and back-slash escapes to recognized, but to treat single quotes as regular characters.

    It looks like the only way to do what you want is to copy-and-paste the source code for sub parse_line into your script or module, and then go through and remove the ' characters from the key regexes -- for instance, changing "' to ".