[Chapter 7] 7.2.68 Text::ParseWords - Parse Text into a List of Tokens
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T02:04:33Z

#

| Chapter 7 The Standard Perl Library |

### 7.2.68 Text::ParseWords - Parse Text into a List of Tokens

    use Text::ParseWords;
    @words = quotewords($delim, $keep, @lines);

`quotewords()` accepts a delimiter (which can be a regular expression) and a list of lines, and then breaks those lines up into a list of delimiter-separated words. It ignores delimiters that appear inside single or double quotes.

The `$keep` argument is a Boolean flag. If it is false, then quotes are removed from the list of words returned by `quotewords()`; otherwise, quotes are retained.

The value of `$keep` also affects the interpretation of backslashes. If `$keep` is true, then backslashes are fully preserved in the returned list of words. Otherwise, a single backslash disappears and a double backslash is returned as a single backslash. (Be aware, however, that, regardless of the value of `$keep`, a single backslash occurring within quotes causes a Perl syntax error - presumably a bug.)

7.2.67 Text::Abbrev - Create an Abbreviation Table from a List |  | 7.2.69 Text::Soundex - The Soundex Algorithm Described by Knuth