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: [odubiel] help with While statement; and reading with ord: Edit Log



Laurent_R
Veteran / Moderator

Mar 25, 2013, 11:32 AM


Views: 341
Re: [odubiel] help with While statement; and reading with ord

The getc function will read one character at a time from your file, you just need to put it in a while loop.


Code
while (my $c = getc $FILHANDLE) { 
my $ascii_value = ord $c;
# etc. Put there your conversion and
# the writing to the output file
}



(This post was edited by Laurent_R on Mar 25, 2013, 12:57 PM)


Edit Log:
Post edited by Laurent_R (Veteran) on Mar 25, 2013, 12:57 PM: added the code tags which I had forgotten


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

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