#!/usr/bin/perl use strict; use warnings; use diagnostics; use Data::Dumper; use IPC::Run qw(start pump finish timeout harness); $ENV{IPCRUNDEBUG}="data"; # debug modus my ($in,$out,$err); my @prog = ('gpg2'); my $handle = start \@prog, \$in, \$out, \$err, 10; pump $handle until length $out; if ($out =~ /gpg: Go ahead and type your message/mg) { $in = "Kleiner Test\r\n"; } pump $handle until length $out; finish $handle or die "@prog beendet mit Fehlercode $?"; print "Ausgabe:\n$out";