in reply to Re: Opening not-existing command - Error Handling
in thread Opening not-existing command - Error Handling

Thank you. Sounds good. I tried it. But my problem is now that I always get the message "Cannot locate command" for a existing command and for a not-existing command.

  • Comment on Re^2: Opening not-existing command - Error Handling

Replies are listed 'Best First'.
Re^3: Opening not-existing command - Error Handling
by Tanktalus (Canon) on Aug 16, 2011 at 13:20 UTC

    Remember that "dir" is not an executable. It's a shell built-in. So try "cmd /c dir" as your command (and thus your executable is "cmd"). Though, really, dir is a bad example because it's so trivial to do inside perl. Other built-ins may be more difficult/impossible to emulate in perl, so the question is still more or less valid as a general question, just not so much for this particular example.