summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-06-30 14:40:22 +0300
committerGurusamy Sarathy <gsar@cpan.org>1998-07-04 02:26:37 +0000
commit167b9ebce1370822e3adc91ae2094f2b80621ae9 (patch)
tree6b00e6fb02d09d9bb17a0d4b3f414803b232f7ea
parent3a385817d2de99623faa930440acc28f969b094c (diff)
downloadperl-167b9ebce1370822e3adc91ae2094f2b80621ae9.tar.gz
5.004_69: Parsewords.pm: avoid undefined warnings
Message-Id: <199806300840.LAA04872@alpha.hut.fi> p4raw-id: //depot/perl@1283
-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);