You are looking at a very old, but free version of the course. If you are interesed the most recent version, check it out on the Perl Maven site.

7.21. Capturing both STDOUT and STDERR using IPC::Run3

Example 7-11. examples/io/

#!/usr/bin/perl -w
use strict;

use Test::More tests => 2;
use IPC::Run3;

my $app = "./examples/io/";

my @in = ('10', '21', 'hello', '3x');
my $in = join "\n", @in;

my @expected_out = ('20', '42');
my @expected_err = (
		"The input 'hello' contains no numeric values", 
		"The input '3x' contains no numeric values",

	my $out;
	my $err;
	run3 [$app], \$in, \$out, \$err;

	my $expected_out = join("\n", @expected_out) . "\n";
	is($out, $expected_out, "IPC Output");
	my $expected_err = join("\n", @expected_err) . "\n";
	is($err, $expected_err, "IPC Error");

If you are interested in on-site trainings by the author, please contact me directly.