in reply to Re^5: System command silent screen
in thread System command silent screen
No, it isn't perfect. It invokes an unknown shell with unquoted arguments. That's begging for trouble.
If there is a non-zero number of arguments, the following remove the need for quoting:
use IPC::Open3 qw( open3 ); { open(local *FR_NULL, '<', '/dev/null') or die; open(local *TO_NULL, '>', '/dev/null') or die; my $pid = open3('<&FR_NULL', '>&TO_NULL', undef, $command, @arguments); waitpid($pid, 0) or die; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: System command silent screen
by locked_user sundialsvc4 (Abbot) on Oct 11, 2010 at 13:31 UTC | |
by ikegami (Patriarch) on Oct 11, 2010 at 18:24 UTC |