Since your primary concern is passing the arguments on correcty, why not do:
This depends on whether quotemeta does the kind of escaping you need, but it seems to be a reasonable start.@ARGV = map { quotemeta($_) } @ARGV; print "@ARGV"; __OUTPUT__ > perl test.pl -s "1 2 3" \-s 1\ 2\ 3
In reply to Re: command line and quotes
by Joost
in thread command line and quotes
by skerr1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |