in reply to My little 123.pl application...
sysread() and read() return the number of bytes read and there is no guarantee that the number of bytes read will be the same as the number of bytes requested in $buffer_size so your code is making a possibly invalid assumption.406 my $buffer_size = 1024; 407 408 my $on = 0; 409 410 while (sysread(ORGINAL, my $buffer, $buffer_size)) { 411 syswrite(ENCRYPTED, $cipher->crypt($buffer)); 412 413 $on += $buffer_size;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: My little 123.pl application...
by Ace128 (Hermit) on Apr 22, 2006 at 15:35 UTC | |
by jwkrahn (Abbot) on Apr 23, 2006 at 00:36 UTC |