avoid CRLF in byteloadable files created by perlcc
Gurusamy Sarathy [Thu, 30 Dec 1999 19:36:21 +0000 (19:36 +0000)]
p4raw-id: //depot/perl@4741

utils/perlcc.PL

index a8c6ab4..734b20a 100644 (file)
@@ -257,20 +257,19 @@ sub _createCode
 
     local($") = " -I";
 
-    open(GENFILE, "> $generated_file") || die "Can't open $generated_file: $!";
-
     if ($backend eq "Bytecode")
     {
         require ByteLoader;
 
+       open(GENFILE, "> $generated_file") || die "Can't open $generated_file: $!";
+       binmode GENFILE;
         print GENFILE "#!$^X\n" if @_ == 3;
         print GENFILE "use ByteLoader $ByteLoader::VERSION;\n";
+       close(GENFILE);
 
        $output_switch ="a";
     }
 
-    close(GENFILE);
-
     if (@_ == 3)                                   # compiling a program   
     {
         chmod $generated_file, 0777 & ~umask if $backend eq "Bytecode";