From 167b9ebce1370822e3adc91ae2094f2b80621ae9 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Tue, 30 Jun 1998 14:40:22 +0300 Subject: 5.004_69: Parsewords.pm: avoid undefined warnings Message-Id: <199806300840.LAA04872@alpha.hut.fi> p4raw-id: //depot/perl@1283 --- lib/Text/ParseWords.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/Text/ParseWords.pm') 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); -- cgit v1.2.1