# Start the pgp decrypt process. ($decrypt = Expect->spawn("pgp $pgpfile")) || die "Couldn't spawn pgp decrypt, $!"; # Check to see for the password prompt. If prompted then post the password. if($decrypt->expect(30,"Enter pass phrase: ")){ sleep(3); print $decrypt "pass phrase goes here\r"; }