chinesebob has asked for the wisdom of the Perl Monks concerning the following question:
sub process_dir{ my $directory = shift; my @file = &open_directory($directory); for my $processing(@file){ my $file= &encrypt_file($processing); my $encrypted_output = "$dir/$processing"; #$dir is a global d +eclared at the top open OUT, "> $encrypted_output" || die "can't $!"; select OUT; print $file; rename("$dir/$file", "$dir/$file.pgp"); } } sub encrypt_file{ my $file = shift; my $pgp = Crypt::OpenPGP->new; my $ciphertext = $pgp-encrypt( Filename => $file, Recipient => $key_id, Armour => 1, ); return($ciphertext);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I get the output of Crypt::OpenPGP to a file
by dga (Hermit) on Apr 04, 2003 at 16:11 UTC | |
|
Re: How do I get the output of Crypt::OpenPGP to a file
by hardburn (Abbot) on Apr 04, 2003 at 16:14 UTC | |
|
Re: How do I get the output of Crypt::OpenPGP to a file
by Aragorn (Curate) on Apr 04, 2003 at 16:15 UTC |