[rt.cpan.org #57680] ->Set() method does not translate \n to \r\n

[email protected] ("smu johnson via RT")
Newsgroups perl.libwin32
Message-ID <[email protected]>
Thu May 20 17:50:08 2010: Request 57680 was acted upon.
Transaction: Ticket created by [email protected]
       Queue: Win32-Clipboard
     Subject: ->Set() method does not translate \n to \r\n
   Broken in: (no value)
    Severity: Important
       Owner: Nobody
  Requestors: [email protected]
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=57680 >


# the following code, when pasted in windows, attaches it all as if it's
one string.  in order to get it to not to do that, you have to manually
make a substitution (or any other way) to convert \n's to \r\n's...

use v5.10.0;
use strict;

use Win32::Clipboard;
my $CLIP = Win32::Clipboard();

my $buffer = "happy\njohn\n\nof\nnewark";

say "Trying to copy the following buffer:";
say $buffer;
$CLIP->Set($buffer);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.