summaryrefslogtreecommitdiff
path: root/lib/Text/ParseWords.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Text/ParseWords.pm')
-rw-r--r--lib/Text/ParseWords.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Text/ParseWords.pm b/lib/Text/ParseWords.pm
index 95f0e9b41f..2414f805b5 100644
--- a/lib/Text/ParseWords.pm
+++ b/lib/Text/ParseWords.pm
@@ -76,10 +76,12 @@ sub parse_line {
}
else {
$unquoted =~ s/\\(.)/$1/g;
- $quoted =~ s/\\(.)/$1/g if ($quote eq '"');
- $quoted =~ s/\\([\\'])/$1/g if ( $PERL_SINGLE_QUOTE && $quote eq "'");
+ if (defined $quote) {
+ $quoted =~ s/\\(.)/$1/g if ($quote eq '"');
+ $quoted =~ s/\\([\\'])/$1/g if ( $PERL_SINGLE_QUOTE && $quote eq "'");
+ }
}
- $word .= ($quote) ? $quoted : $unquoted;
+ $word .= defined $quote ? $quoted : $unquoted;
if (length($delim)) {
push(@pieces, $word);