in reply to Re: Running System Commans With ""
in thread Running System Commands With ""

What does that do on an OS where a new process gets a single string? If it just concatenates the list together, you're back where you started.

Replies are listed 'Best First'.
Re: Re: Re: Running System Commans With ""
by fruiture (Curate) on Sep 12, 2002 at 14:13 UTC

    I don't even know any OS that does so. But still it's more secure, because still no shell is started and no shell-tricks can be used. But an OS without 'char *argv[]' probably also doesn't know a shell, .. ? :)

    --
    http://fruiture.de
      Windows gets a command-line tail (a single string) in the new process, as did DOS before it and CPM.

      The run-time library chops it up to populate argc/argv before calling main.

      As for when Perl uses a shell vs. calls the process directly, there is lots of OS-specific case code in there. I looked through it for Windows to see what it really did, and probably posted an expose here in PM, but I can't remember the details. Every other OS has its own special stuff, too, so it's quite non-portable to make such assumptions.