IPC::System::Simple – Run commands simply, with detailed diagnostics
use IPC::System::Simple qw(system systemx capture capturex);
system("some_command"); # Command succeeds or dies!
system("some_command",@args); # Succeeds or dies, avoids shell if @args
systemx("some_command",@args); # Succeeds or dies, NEVER uses the shell
# Capture the output of a command (just like backticks). Dies on error.
my $output = capture("some_command");
# Just like backticks in list context. Dies on error.
my @output = capture("some_command");
# As above, but avoids the shell if @args is non-empty
my $output = capture("some_command", @args);
# As above, but NEVER invokes the shell.
my $output = capturex("some_command", @args);
my @output = capturex("some_command", @args);
Awesome! I’ve been doing things similar to capturex() for years, but this is just so much better.
There are times when I hate you PJF!



