Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Binary Challenge

by tachyon (Chancellor)
on Mar 19, 2002 at 10:30 UTC ( [id://152705]=note: print w/replies, xml ) Need Help??


in reply to Re: Binary Challenge
in thread Binary Challenge

When you write while(<IMAGE>)... you will read in a chunk of image until you get to the binary for a newline char 00001010. Thus you will read in random length chunks of data. You should really use read(). You should also consider binmode which is essential on Win32 and harmless on *nix.

open IMG, $image or die $!; binmode IMG; binmode STDOUT; my $buffer; while (read(IMG, $buffer, 1024)) { print $buffer; # etc }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://152705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found