http://www.perlmonks.org?node_id=981007


in reply to Redirect output of the system() command

Your "system" call may be getting confused because you have used "qw()", and your options contain quoted text that you expect to be retained as a single array element.

When you feed "Here is our Title" to qw(), you would end up with 4 elements, not one. This would result in positional parameters being in the wrong place.

             I hope life isn't a big joke, because I don't get it.
                   -SNL

  • Comment on Re: Redirect output of the system() command

Replies are listed 'Best First'.
Re^2: Redirect output of the system() command
by monsoon (Pilgrim) on Jul 11, 2012 at 05:37 UTC
    'system' takes a list. @options gives it that list in exactly the order that was specified by 'qw'. Space separated items can be combined into a single string or can be standalone list items. Now how would in this case the positional parameters end up in the wrong place?
      See Your Mother's comments below.

      I wasn't clear in my previous node - what I meant by "wrong place" was that multiple spaces would be collapsed in a quoted string. (or maybe I'm making that up now - can't remember what I was thinking).

                   I hope life isn't a big joke, because I don't get it.
                         -SNL