Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: IPC::Run3 error

by chrestomanci (Priest)
on Mar 10, 2011 at 13:40 UTC ( [id://892412]=note: print w/replies, xml ) Need Help??


in reply to Re: IPC::Run3 error
in thread IPC::Run3 error

Point of clarification:

I think the OP probably does not know that if you pass a scalar to system (or exec) then the shell is involved, but if you pass an array, then the shell get's bypassed, and the named command is run directly.

eg, This will pass the entire command string to the shell, which will in turn invoke find, and setup a pipe to send the output to p4.

system('find -type f | p4 -x - add')

You might try this, but it would not work, as the find command would receive all the other arguments, and would not know how to process anything after the pipe character.

system('find', '-type', 'f', '|', 'p4', '-x', '-', 'add')

Back to the OP's question. Under windows, the DIR command is a shell built in, so in order to invoke it, you must invoke the shell. There is not DIR.exe system file that could be invoked outside the shell.

Replies are listed 'Best First'.
Re^3: IPC::Run3 error
by Anonymous Monk on Mar 10, 2011 at 13:53 UTC
    Except that there is, and it comes from gnuwin32, and its the cause of the error messages "dir: /b: No such file or directory " ...

      The garbage he's giving to it (e.g. "/b") is the cause of the error messages.

      If he invokes dir through a shell, the shell builtin would be invoked, and it takes "/b".

      If he invokes dir dircetly, the gnuwin32 executable would be invoked, and it doesn't take "/b".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://892412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found