#!/usr/bin/perl use Expect; use strict; use warnings; # create an Expect object by spawning another process my $exp = Expect->spawn($command, @params); $exp->send("yes");