in reply to Syntax details with "system"

As far as I can see, the error must be due to a difference between the two variants of the system call, but I don't see where.

Check system. It says:
If there is only one scalar argument, the argument is checked for shell metacharacters, and if there are any, the entire argument is passed to the system's command shell for parsing
And
If there is more than one argument in LIST, or if LIST is an array with more than one value, starts the program given by the first element of the list with arguments given by the rest of the list.

Replies are listed 'Best First'.
Re^2: Syntax details with "system"
by Anonymous Monk on Jul 19, 2012 at 20:07 UTC

    I read that multiple times :-) (I wouldn't dare post otherwise). I guess my problem is that I don't understand what it says.

    What are "shell metacharacters"? All those variables are defined in the Perl script, so they should be resolved in the script. Are \" shell metacharacters? And what about > and <? They occur in Perl when you open a pipe, but this is sort of different...or maybe not...?

    Also, what difference does it make whether Perl starts qrsh with that whole list of arguments, or whether the shell does? And when Perl starts qrsh, what about > and <, *if* they are "shell metacharacters"? How do they get interpreted?

    In the one-argument case, I can print the whole string to see what it is resolved to. But what about the multiple argument case? How do I know what that really works out to (so that I can write the same thing in when I call capture_exec)?

      What are "shell metacharacters"?

      [ddg://What are "shell metacharacters"?] What are "shell metacharacters"? ... Characters used for input or output in UNIX shells having special meaning.