in reply to Re: Re: Parsing strings into @ARGV
in thread Parsing strings into @ARGV
The bug is the unrestricted deletion of trailing whitespace - it shouldn't delete whitespace that's preceeded by the right number of backslashes. I'll see if I can come up with a patch later tonight.sub shellwords { local(@lines) = @_; $lines[$#lines] =~ s/\s+$//; return(quotewords('\s+', 0, @lines)); }
Note that that's not the only case where Text::ParseWords and my shell (bash) disagrees. Given the string "foo\'bar", my shell parses that as foo\'bar, while Text::ParseWords turns it into foo'bar.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing strings into @ARGV
by mirod (Canon) on Apr 23, 2004 at 16:15 UTC | |
by Abigail-II (Bishop) on Apr 23, 2004 at 16:45 UTC | |
by mirod (Canon) on Apr 23, 2004 at 17:39 UTC | |
|
Re: Re: Parsing strings into @ARGV
by mirod (Canon) on Apr 23, 2004 at 16:24 UTC | |
by chromatic (Archbishop) on Apr 23, 2004 at 16:34 UTC |