Gerard has asked for the wisdom of the Perl Monks concerning the following question:
How do I convert the byte stored in $result to the 0's and 1's that it represents? Well there is a bit more to it than that, but that would be a good place to start. (Haven't done much file processing in the past).open (IN, "< ./someinputfile") || die $!; open (OUT, "> ./someoutputfile") || die $!; binmode IN; binmode OUT; my $read = 1; my $result; while($read > 0){ $read = read IN,$result,1; #do some processing and checking here. #convert the bits to bytes print OUT $result; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bytes to bits
by dragonchild (Archbishop) on Aug 14, 2003 at 14:59 UTC | |
by Gerard (Pilgrim) on Aug 14, 2003 at 15:11 UTC | |
|
Re: Bytes to bits
by Abigail-II (Bishop) on Aug 14, 2003 at 14:59 UTC | |
|
Re: Bytes to bits
by bfish (Novice) on Aug 14, 2003 at 16:22 UTC | |
|
Re: Bytes to bits
by NetWallah (Canon) on Aug 14, 2003 at 17:56 UTC |