Posts Tagged ‘Perl’

IPC::System::Simple

Wednesday, March 18th, 2009

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!

Constraints and Software Development – O’Reilly ONLamp Blog

Tuesday, October 2nd, 2007

Constraints and Software Development – O’Reilly ONLamp Blog

“Constraints are Good”

use Perl | Slides from NY Inside-Out Talk

Tuesday, January 24th, 2006

Interesting alternative approach to classes/objects in Perl 5

use Perl | Slides from NY Inside-Out Talk