# Start the pgp decrypt process. ($decrypt = Expect->spawn("pgp $pgpfile")) || die "Couldn't spawn pgp decrypt, $!"; # Wait for 10 seconds then post the password. sleep(10); print $decrypt "pass phrase goes here\r"; if(-e $outfile){ $message="$pgpfile decrypted successfully to $outfile."; } else{ $message="$pgpfile NOT decrypted to $outfile!"; } sleep(5); system("mv $pgpfile archive/");