Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advanced for your help.sub cksum{ my $word_count; my $bias=0; my $checksum=0; my $srcfile="../vxWorks.dsu_flt-rom.bin"; my $buffer; open INF, $srcfile or die "\nCan't open $srcfile for reading: $!\n"; print "Cannot open file.\n"; binmode INF; $checksum = $bias; #while ($word_count>=0) while ( read (INF, $buffer, 32) #and print OUTF $buffer +# exit if read or write fails ) {$checksum = $checksum + $buffer}; #adding goes here $checksum = $checksum & 0xFFFFFFFF; print "This is the checksum: $checksum"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print command not working in script
by jwkrahn (Abbot) on Jul 13, 2009 at 16:12 UTC | |
|
Re: Print command not working in script
by jethro (Monsignor) on Jul 13, 2009 at 17:24 UTC | |
|
Re: Print command not working in script
by spazm (Monk) on Jul 13, 2009 at 17:29 UTC |