summaryrefslogtreecommitdiff
path: root/lib/Text
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-05-01 02:03:41 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-05-01 02:03:41 +0000
commitfb7007dcbd6dbc115b028fb921a92d9dd26e2902 (patch)
treeb48c3639f7bd9a75ade19a56a6ef3c15a5bef92c /lib/Text
parentc0ee6f5c4ced6a652202f9e7ad8d0b76aa70994f (diff)
downloadperl-fb7007dcbd6dbc115b028fb921a92d9dd26e2902.tar.gz
Allow for "0" as a word
Diffstat (limited to 'lib/Text')
-rw-r--r--lib/Text/ParseWords.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Text/ParseWords.pm b/lib/Text/ParseWords.pm
index 89951387ef..317597cb83 100644
--- a/lib/Text/ParseWords.pm
+++ b/lib/Text/ParseWords.pm
@@ -92,7 +92,7 @@ sub quotewords {
local(@words,$snippet,$field,$_);
$_ = join('', @lines);
- while ($_) {
+ while (length($_)) {
$field = '';
for (;;) {
$snippet = '';
@@ -111,11 +111,11 @@ sub quotewords {
$snippet = $1;
$snippet = "\\$snippet" if ($keep);
}
- elsif (!$_ || s/^$delim//) {
+ elsif (!length($_) || s/^$delim//) {
last;
}
else {
- while ($_ && !(/^$delim/ || /^['"\\]/)) {
+ while (length($_) && !(/^$delim/ || /^['"\\]/)) {
$snippet .= substr($_, 0, 1);
substr($_, 0, 1) = '';
}