in reply to Re^6: system and wildcard expansion?
in thread system and wildcard expansion?

My point was that they are both single scalars, sans meta-characters, but still get passed to the shell. Hence contradicting your quote from the docs.
I think what the perldocs say is that bypassing the shell is an optimization. Being a language not bound to a particular operating system, I think it is not practical to document in advance how this will be handled in general. As in your case with a call invoking file association, it is very natural that system uses the shell.
Personally, I wish Perl would simply pass single scalars directly to the shell and let it work out what happens.
You can always enforce it, by writing system('cmd /c Your Command Goes Here').
As is the standard Windows practice of looking in the current directory for executables before chasing the path.
AFIK, this behaviour is kept even if the shell is not involved.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^8: system and wildcard expansion?
by BrowserUk (Patriarch) on Nov 12, 2010 at 11:54 UTC
    AFIK, this behaviour is kept even if the shell is not involved.

    Apparently not. From win32.c source (circa line 4225):

    /* initial NULL argument to CreateProcess() does a PATH * search, but it always first looks in the directory * where the current process was started, which behavior * is undesirable for backward compatibility. So we * jump through our own hoops by picking out the path * we really want it to use. */

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Clever! I didn't notice it, because (out of my dangerous habit when using Unix), I always kept '.' in the PATH...

      Thanks for pointing this out.

      -- 
      Ronald Fischer <ynnor@mm.st>