On Jul 27, 7:00 pm, [EMAIL PROTECTED] (Cheater) wrote:
> I am attempting to load an image using the standard open function. I
> then binmode the file handle. But when I attempt to write the image to
> a new file (to try and create a duplicate), the new file becomes
> unreadable. I know I could just copy the file itself without opening
> it, but I need to do it this way.

Says who?   If you know a way to get it to work, what possible reason
is there to do it differently, unless of course this is homework.  In
which case, go ask your teacher.

> Any help would be greatly
> appreciated. Here is my code.
>
> open (IMAGE, $imgfile) || die "Can't Open $imgfile\n";
>         binmode(IMAGE);
>
> open (OUTPUT, ">$outputfile") || die "Can't Open $outputfile\n";
>         binmode(OUTPUT);
>         print OUTPUT while (<IMAGE>);

<IMAGE> reads using newlines.  There is no such concept in a binary
file.

perldoc -f read

Paul Lalli


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to