Thread Problem mit Digest::CRC (7 answers)
Opened by bianca at 2011-08-08 18:58

bianca
 2011-08-08 18:58
#151345 #151345
User since
2009-09-13
6979 Artikel
BenutzerIn

user image
Komme irgendwie mit dem Modul nicht klar.
Lasse das u.a. Script auf Win 7 mit Strawberry 5.10 und dem Modul 0.14 laufen. Das läuft und läuft und läuft. Irgendwann drücke ich STRG C zum Abbruch und dann kommt das raus:
Quote
Start...
Can't coerce UNKNOWN to string in bit_and at Ò[☺nt_r='undef'
d_endpwent='undef'
d_endpwent_r='undef'
d_endsent='undef'
d_endservent_r='undef'
d_eofnblk='define'
d_eunice='undef'
d_faststdio='define'
d_fchdir='undef'
d_fchmod='undef'
d_fchown='undef'
d_fcntl='und(eval 2) line 48.
Use of uninitialized value in substr at (eval 2) line 49.
Use of uninitialized value in substr at (eval 2) line 49.
Use of uninitialized value in bitwise xor (^) at (eval 2) line 49.
Use of uninitialized value in bitwise and (&) at (eval 2) line 49.
Use of uninitialized value in bitwise xor (^) at (eval 2) line 49.


more (9.2kb):
Code (perl): (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
26
27
28
29
30
31
32
33
#!/usr/bin/perl -w
use strict;
use warnings;
use Fcntl qw (:DEFAULT :flock);
use Digest::CRC;

my $datei = 'test_crc.txt';
my $fh;

# Datei erzeugen
srand (time ^ $$);
my @atoms = ('a'..'z', 'A'..'Z' ,0..9);
sysopen ($fh,$datei,O_RDWR|O_CREAT) or die "$!";
seek ($fh,0,0);
truncate ($fh,0);
my $string = '';
my $l = 0;
while ($l < 500 * 1024 * 1024) {
    $string .= $atoms[rand scalar @atoms] . $string . $atoms[rand scalar @atoms];
    $l += length ($string);
    print $fh $string;
}

# Quersumme
print "Start...\n";
my $start = time ();
my $ctx = Digest::CRC -> new (type => "crc32");
seek ($fh,0,0);
$ctx -> addfile ($fh);
my $crc = $ctx -> digest;
my $ende = time ();
print "$crc\n";
print "Zeit: " . ($ende - $start) . " Sec\n";

Was mache ich falsch?

Editiert von bianca: Type
Last edited: 2011-08-08 19:00:18 +0200 (CEST)
10 print "Hallo"
20 goto 10

View full thread Problem mit Digest::CRC