# start the ipc $h = start \@cmd, \$in, \$out ; # send login info, keep reading until shell prompt $in = "$password\n" ; pump $h until $out =~ /BRU Server >/i ; # do what we need to do $in = "backup -some -params\n" ; pump $h until $out =~ /BRU Server >/i ; print "Output:\n$output"; # and, we're done here $in = "exit\n" ; pump $h while length $in; finish $h or die "oh crap: $?";