Change file handle to binary mode : binmode « File « Perl






Change file handle to binary mode

    


open (FILEHANDLE, ">data.txt") 
    or die ("Cannot open data.txt");

binmode FILEHANDLE;

print FILEHANDLE "Hello\nthere!";

close (FILEHANDLE);

   
    
    
    
  








Related examples in the same category

1.Copy file by reading one file and save to another file
2.binmode command sets up a file for access in binary mode with no mapping of carriage returns.
3.Win32 Binary Files
4.Unbuffered perl io