
cupofdoug
Novice
Apr 16, 2013, 10:21 PM
Post #11 of 16
(4905 views)
|
Re: [FishMonger] Appending to the end of a line from an input file
[In reply to]
|
Can't Post
|
|
Ah yes, the strings must all be uniformly 6 digits so they can be read in the next phase of the program 6 digits at a time. Alas, I'm stuck again. Earlier in the program I converted plain text to its ASCII value, then ASCII to binary using the following code:
my $chunk2; while (read(OUTFILE, $chunk2, 1)) { my $asciiChar = ord $chunk2; my $binary = sprintf("%08b", $asciiChar); print OUT2 $binary; I was given the "my $binary = sprintf("%08b", $asciiChar);" part, and I'm not sure of how it works to convert an ascii character to binary, and now I need to convert binary back to ascii (and then ascii back to plaintext, I'm assuming using the "chr" function). So basically I have to reverse this process. Thanks again for any suggestions.
(This post was edited by cupofdoug on Apr 16, 2013, 10:27 PM)
|