Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Binary Printing

Expand Messages
  • Jabir Ahmed
    try using single quotes instead of double.. try this print ABC n n n n n n n n n n n n n n n nXYZ ; or print ABC n n n n....XYZ ; ... From: gadgetseeker
    Message 1 of 1 , Jun 24, 2007
    • 0 Attachment
      try using single quotes instead of double..
      try this
      print 'ABC\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nXYZ';
      or
      print "ABC\\n\\n\\n\\n....XYZ";


      ----- Original Message -----
      From: gadgetseeker
      To: perl-beginner@yahoogroups.com
      Sent: Monday, June 25, 2007 9:37 AM
      Subject: [PBML] Binary Printing


      I need to print data to a file in binary format. Any "\n" should be
      printed as-is without being converted to a new-line character.

      I tried the following code, but all instances of the "\n" were
      coverted to new-line characters.

      -----------------------------------------------
      #!/usr/bin/perl
      open($fh,'>','temp.txt');
      binmode($fh);
      select($fh);
      print "ABC\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nXYZ";
      close($fh);
      -----------------------------------------------

      I also tried the following line to no avail:
      open($fh,'>:raw','temp.txt');

      Any help will be appreciated.





      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.