Skip Menu |

This queue is for tickets about the Crypt-OpenPGP CPAN distribution.

Report information
The Basics
Id: 59781
Status: open
Priority: 0/
Queue: Crypt-OpenPGP

People
Owner: Nobody in particular
Requestors: xiaojun.tan [...] picis.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.04
Fixed in: (no value)



Subject: Can't locate object method "save" via package "Crypt::OpenPGP::Trust"
After loaded GnuPGP key ring files (pubring.gpg and secring,gpg), when I'm looping through the blocks and call 'save' for each of them like: foreach($keyring->blocks) { print $filehandle $_->save(); } The keyblocks are printed, however, I got an error in the loop: Can't locate object method "save" via package "Crypt::OpenPGP::Trust" at Crypt/OpenPGP/PacketFactory.pm line 135.
Same Problem here. Is there a simple workaround for this ? 

Subject: RE: [rt.cpan.org #59781] Can't locate object method "save" via package "Crypt::OpenPGP::Trust"
Date: Mon, 7 Mar 2011 16:37:50 -0500
To: "bug-Crypt-OpenPGP [...] rt.cpan.org" <bug-Crypt-OpenPGP [...] rt.cpan.org>
From: Xiaojun Tan <Xiaojun_Tan [...] picis.com>
My final working code: sub import_key { my ($file) = @_; my $theirs = new Crypt::OpenPGP::KeyRing( Filename => $file ) || die Crypt::OpenPGP::KeyRing->errstr; $theirs->read(); my $change; foreach my $block ($theirs->blocks) { my $found; foreach ($pubring->blocks) { if ($_->key()->key_id_hex() eq $block->key()->key_id_hex()) { printf "key %s: not changed\n", block->key()->key_id_hex(); $found++; last; } } if (not $found) { $pubring->add($block); $change++; } } if ($change) { write_keyring_file($pubring, $local_pubring); } } sub write_keyring_file { my ($keyring, $file) = @_; open my $filehandle, ">", $file; binmode $filehandle; foreach($keyring->blocks) { print $filehandle $_->save(); } close $filehandle; } Show quoted text
-----Original Message----- From: Roland Huss via RT [mailto:bug-Crypt-OpenPGP@rt.cpan.org] Sent: Saturday, March 05, 2011 10:13 AM To: Xiaojun Tan Subject: [rt.cpan.org #59781] Can't locate object method "save" via package "Crypt::OpenPGP::Trust" <URL: https://rt.cpan.org/Ticket/Display.html?id=59781 > Same Problem here. Is there a simple workaround for this ? The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access or use by any other person to this internet email is not authorized and may be unlawful. If you are not the intended recipient, please delete or destroy this email. If you do not wish to receive future emails from this sender, please reply directly to this email requesting you be removed from any mailing list.