Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Text::ParseWords parse_line containing quote

by LanceDeeply (Chaplain)
on Jul 24, 2003 at 19:01 UTC ( [id://277647]=note: print w/replies, xml ) Need Help??


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 ".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://277647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 04:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found