# This code is provided "as is" with NO WARRANTY expressed or # implied. You may use it freely at your own risk. #!/usr/bin/perl # if you're using PGP, you MAY use this line # $ENV{'PGPPASS'} = 'my clever pass phrase'; $records = `cat form_data.txt`; # I separate records with 14 has marks. You can use # something else if you like! @records = split(/##############/, $records); foreach $record(@records) { open(RECORD, ">record.tmp"); print RECORD $record; close RECORD; #if using GnuPG, your pass phrase is stored in a file # you stuff into STDIN. Don't use this line for PGP open(STDIN, 'passcode'); $results = `gpg -d --batch --passphrase-fd 0 record.tmp 2> /dev/null`; # or, for PGP # $results = `cat record.tmp | pgp -fd`; # or, using the command line instead of the environment # $results = `cat record.tmp | pgp -fd -z "my clever pass phrase"`; # if PGP, don't need the next line close STDIN; # We'll just print to STDOUT, but you may # want to do something more print $results; }