L. Neil Johnson wrote:

> An MS-DOS batch file launches a PERL script which calculates input 
> specifications for a filter-design program written in FORTRAN running under 
> cygwin's shell for MS-DOS.  The specifications are written by PERL to many 
> text-files which are read by the UNIX-based program. Therein lies the 
> problem. PERL for Win32 writes the line terminators as CRLF (0x0d0a), and 
> the UNIX-based program blows up reading the "unexpected character" CR. What 
> we want to do is write LF (0x0a) as the text-file termination character. 
>  Simple, no?

Ignore the $\ operator - just binmode your stdout and/or stderr :

$| = 1; binmode STDOUT;                                 # binmode stdout
select ((select (STDERR), $| = 1)[0]); binmode STDERR;  # binmode stderr

Then just use \n as your newline when wanted and it will be fine on UNIX.

I use the above code in all my test scripts and had to disable it to get
your code to fail.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to