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

Re: [MacPerl] Re: Using NetPresenz and MacPerl



On 11/15/96 Patton, Paul B (MN10) wrote:

>It would be nice if Perl had a portable way to detect the platform that
>it is running on.  Maybe there is a good way and I just don't know it.

What about checking the EOL chars (Mac = CR, UNIX = LF, DOS =CR/LF)??

It might be possible to automatically set a flag with something like:

  $test = "\n";
  $test eq "\015" and $os = 'Mac';
  $test eq "\012" and $os = 'Unix';
  $test eq "\015\012" and $os = 'DOS';

What do others think?

RR

__________________________________________________________________________
  Richard Rathe, MD                              rrathe@dean.med.ufl.edu
  University of Florida                  http://www.med.ufl.edu/medinfo/