Thread IO::File::Crypt: Gibts sowas? (26 answers)
Opened by esskar at 2005-02-08 11:29

esskar
 2005-02-13 19:50
#51618 #51618
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
[quote=sri,13.02.2005, 18:35]Das ist sehr pfui, macht mehrere instanzen naemlich unmoeglich[/quote]
"Ich glaube nicht, Tim!"

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;

use PerlIO::via::CBC;

my $file = 'test.cbc';
my $key = 'my secret key';
my $text = "this is just a little blind text!\nthis is just a little blind text!\nthis is just a little blind text!";

PerlIO::via::CBC->config(key => $key);

open( my $out, '>:via(PerlIO::via::CBC)', $file );
PerlIO::via::CBC->config(key => 'test');
open( my $out2, '>:via(PerlIO::via::CBC)', "$file.tmp" );
print $out $text;
close $out;

PerlIO::via::CBC->config(key => $key);
open( my $in, '<:via(PerlIO::via::CBC)', $file);
while(<$in>)
{
PerlIO::via::CBC->config(key => $_);
chomp;
print "[$_]\n";
}
close $in;

View full thread IO::File::Crypt: Gibts sowas?