CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [FishMonger] Appending to the end of a line from an input file: Edit Log



cupofdoug
Novice

Apr 16, 2013, 10:21 PM


Views: 1167
Re: [FishMonger] Appending to the end of a line from an input file

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:

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)


Edit Log:
Post edited by cupofdoug (Novice) on Apr 16, 2013, 10:27 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives