Have you looked at how your shell passes command line parameters? Traditionally, you need to add the appropriate amount of quoting and escaping to make a shell not split variables on whitespace.
If you really (really) want to reparse @ARGV like "a shell" would (for various amounts of "reparse" and "a shell"), see maybe Text::ParseWords or Text::Shellwords. Personally, I would really avoid that.
In reply to Re: passing parameters from shell script to perl program doesn't preserve spaces
by Corion
in thread passing parameters from shell script to perl program doesn't preserve spaces [solved]
by peterbk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |