Kozz has asked for the wisdom of the Perl Monks concerning the following question:
The problem seems to be that it outputs NOTHING ; no words at all. And the root of the problem lies in the single apostrophe in the string which is part of a conjuction. But if I escape the single-quote by putting a backslash in front of it, then everything is output fine. I could use a regex to place backslashes in front of apostrophes, but are these the only characters that cause this problem? Am I not quite using this module correctly? It seems silly to have to escape the characters -- why won't it just work?use Text::ParseWords; my $heredoc =<<END_OF_HEREDOC; The Text::ParseWords module is the most recent module with which I've struggled. END_OF_HEREDOC my @words = quotewords('\s+', 0, $heredoc); foreach(@words){ print $_ . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text::ParseWords
by derby (Abbot) on Oct 06, 2001 at 05:22 UTC | |
|
Re: Text::ParseWords
by lestrrat (Deacon) on Oct 06, 2001 at 05:49 UTC |