in reply to Safe cross-platform command execution and capture of STDOUT & STDERR

What do you mean by "safely executing local commands"? Different people mean different things by that, and the answers you are seeking can very well depend on that. It seems that you can do something that is "unsafe". But what is it?

Having said that, are you familiar with IPC::Open3? If yes, why doesn't it satisfy your needs? If no, then you should first study IPC::Open3.

Perl --((8:>*
  • Comment on Re: Safe cross-platform command execution and capture of STDOUT & STDERR

Replies are listed 'Best First'.
Re^2: Safe cross-platform command execution and capture of STDOUT & STDERR
by mattski (Initiate) on Nov 25, 2005 at 15:04 UTC
    Hi, Thanks for the reply, sorry I should have expanded on that. This code will be used to execute commands defined by the user but I want to do it in as safe-a-way as possible. I'll take a look at IPC::Open3. thanks, Matt
      This code will be used to execute commands defined by the user but I want to do it in as safe-a-way as possible.
      What do you mean by that? What is "safe"? Should it ask the user if the command is going to remove a file? Should it try to second-guess the user and ask confirmation if the command the user gives may not be what he really wants? Do you first want to make a backup?

      Your definition is utterly vague. As safe as possible would be to not do anything - but I doubt that is what you mean. What are you afraid of might happen? What do you want to protect yourself against?

      Perl --((8:>*