bsb has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to automate a decrypt/edit/encrypt cycle using GPG for the encryption. From perlipc it seemed that it may be a job for Expect.pm.

I tried using Expect but the docs aren't very clear, particularly for this type of task and I couldn't get anything much to work. I just want to write passwords to and check output from gpg.

Firstly, am I on the right track using Expect? Secondly, how are you supposed to use it?

Brad

Replies are listed 'Best First'.
Re: Automating GPG with Expect
by merlyn (Sage) on Jan 15, 2001 at 09:35 UTC
      Thanks, after your CPAN reminder I had a look and settled on GnuPG.

      I'm still curious on how to use Expect properly...
      Is this the sort of things than one would use Expect for?

      Thanks again,
      Brad

(fongsaiyuk)Re: Automating GPG with Expect
by fongsaiyuk (Pilgrim) on Jan 15, 2001 at 19:35 UTC
    Generally speaking, Expect is an effective tool to use when you are trying to automate a process that is highly interactive. Some uses would include automating an FTP session to download patches, or automating a telnet session to run reports from an ERP system.

    Basically "headless" operation. ^-^

    Where I work I use expect to download virus DAT files from McAfee's ftp site.

    If you seek to interact with Telnet or FTP servers, you can accomplish pretty much the same functionality by using Net::FTP or Net::Telnet.

    More esoteric interactions, such as yours I'm sure, would be better solved with Expect.pm or directly using the GnuPG Perl module as merlyn states.

    Good Luck! ^-^

    fongsaiyuk