4 ;# require 'shellwords.pl';
5 ;# @words = shellwords($line);
7 ;# @words = shellwords(@lines);
9 ;# @words = shellwords(); # defaults to $_ (and clobbers it)
12 local *_ = \join('', @_) if @_;
13 my (@words, $snippet);
17 my $field = substr($_, 0, 0); # leave results tainted
19 if (s/\A"(([^"\\]|\\.)*)"//s) {
20 ($snippet = $1) =~ s#\\(.)#$1#sg;
23 die "Unmatched double quote: $_\n";
25 elsif (s/\A'(([^'\\]|\\.)*)'//s) {
26 ($snippet = $1) =~ s#\\(.)#$1#sg;
29 die "Unmatched single quote: $_\n";
31 elsif (s/\A\\(.)//s) {
34 elsif (s/\A([^\s\\'"]+)//) {