Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!wa4mei!holos0!lbr From: lbr@holos0.uucp (Len Reed) Newsgroups: comp.lang.perl Subject: Re: UNIX Perl vs. DOS Perl (arithmetic)? Message-ID: <1991May28.150616.621@holos0.uucp> Date: 28 May 91 15:06:16 GMT References: <1991May23.221206.12903@pinhead.pegasus.com> Organization: Holos Software, Inc., Atlanta, GA Lines: 26 My first guess is that you have binary/text mode problems. MS-DOS perl, like most versions of MS-DOS "C", presume that any file you operate on is "text." When you read the file, any CR/LF is changed to LF; when you write the file, any LF is changed to CR/LF. In addition, if you hit a ^Z on input, it's an end-of-file. Put the following command in your perl script before you do any I/O: binmode(handle); where handle is the perl handle. E.g., binmode(STDOUT); binmode(STDIN); binmode(MYFILE); Do this for each file that manipulates binary data, after the open. Unix perl will politely ignore these staments. Next guess--I don't have a 2nd guess. -Len -- Len Reed Holos Software, Inc. Voice: (404) 496-1358 UUCP: ...!gatech!holos0!lbr