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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Frequently Asked Questions:
How do I handle binary data correctly?



Jan 19, 2001, 3:36 PM

Post #1 of 1 (2148 views)
How do I handle binary data correctly? Can't Post

(From the Perl FAQ)

How do I handle binary data correctly?

Perl is binary clean, so this shouldn't be a problem. For example, this works fine (assuming the files are found):

    if (`cat /vmunix` =~ /gzip/) { 
print "Your kernel is GNU-zip enabled!\n";

On some systems, however, you have to play tedious games with ``text'' versus ``binary'' files. See binmode.

If you're concerned about 8-bit ASCII data, then see the perllocale manpage.

If you want to deal with multibyte characters, however, there are some gotchas. See the section on Regular Expressions.


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

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