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.6. Simple computation - separate send commands

Instead of calling send once, we will call it now 4 times

Example 7-2. examples/bc/

use strict;
use warnings;

use Expect;

my $e = Expect->new;
$e->spawn("bc") or die "Cannot run bc\n";
$e->expect(1, "warranty") or die "no warranty\n";
$e->expect(1, 30) or die "no sum\n";
print "Success\n";

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