in reply to passing parameters from shell script to perl program doesn't preserve spaces [solved]

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.

  • Comment on Re: passing parameters from shell script to perl program doesn't preserve spaces
  • Download Code