Sorry if I am out of line contacting you by email but I didn't see any other
way to ask a question.
 
I am a newbie Perl programmer and I want to pipe plain text to GPG and have
it return the text encrypted.
 
I have read quite a few articles and came up with this chunk of code on my
own BUT it doesn't work and I was wondering if you can tell me what I am
doing wrong...
 
    my $public_key = "nameofpublickey";
    my $plain_text = "this is a test message";
    my $gpg_command = '/usr/local/bin/gpg';
    open (GPGCOMMAND, "|$gpg_command");
    my $encrypted_text = print GPGCOMMAND $plain_text | '$gpg_command -ea -r
$public_key';
    close (GPGCOMMAND);
    print "encrypted text=$encrypted_text";
 
It prints: encrypted text=1
 
What am I doing wrong?
 
Doc
 
_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to