find some examples on how to use STDIO for encrypting and decrypting data here in the PGP Command Line forum:
https://www-secure.symantec.com/connect/forums/stdio-encrypt-decrypt-example-perl