In article <adu83h$4ni$[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] (Ton Hospel) writes:
in the mean time I found in win32/win32.h:
#ifdef PERL_TEXTMODE_SCRIPTS
#  define PERL_SCRIPT_MODE              "r"
#else
#  define PERL_SCRIPT_MODE              "rb"
#endif

and in win32/Makefile

# This should normally be disabled.  Enabling it causes perl to read scripts
# in text mode (which is the 5.005 behavior) and will break ByteLoader.
#BUILDOPT       = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS

So perl may actually read the scripts in binmode on windows.
In which case the scripts should be stored in binmode on windows if you
want things to be equal (which will suck when actually looking
to a multiline script)

I would be interested if someone on windows can run this and report the 
result, also mentioning your perl versions and output of perl -V
----------------------------------------------
#!/usr/bin/perl -w
use strict;

my $prog = "crtest.pl";
my $out  = "crtest.out";
open(my $fh, ">", $prog) || die "Could not create $prog: $!";
print $fh <<"EOF";
#!/usr/bin/perl -w
open(my \$fh, ">", "$out") || die "Could not create $out: \$!";
binmode \$fh;
print \$fh "\cM\cM\n";
close \$fh;
EOF
close $fh;

my $rc = system("$^X", $prog);
die "Unexpected returncode $rc from $prog\n" if $rc;

open(my $result, "<", $out) || die "Could not open $out: $!";
binmode $result;
print unpack("H*", $_), "\n" while <$result>;
close $result;
----------------------------------------------

It should print 0d0a if perl reads source in textmode and
0d0d0a if it reads source in binmode.

Reply via email to