[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Is binmode needed in MacPerl?



At 1:05 PM 9/27/96, you wrote:> At 04:10 PM 9/26/96 -0700, Paul Hoffman wrote:
> >Do I need to use binmode(HANDLE) before I do a read on a non-text file in
> >MacPerl? I would hope not, but wanted to check...

I've always used binmode(HANDLE) when serving GIFs from CGI's. I never
checked whether it's really needed on a Mac, but I think it's good practice
to write code that is portable to other platforms, hence I always used it.

The following CGI script is a variant of yours and does work in MacPerl as
well as Unix Perl:

#!perl
print "Content-type: image/gif\n\n";
open(GIF, "MyDisk:Images:picture.gif") || die "oops!\n";
print(<GIF>);
close GIF;


-Dave