in reply to Re: line breaks on Win32::Clipboard
in thread line breaks on Win32::Clipboard
It works, but it may not be portable between the various Win32 versions of Perl. "\n" can mean different things to differing perls. Best to use the literals (chars 0x0D and 0xOA are CR and LF, respectively). Also, you'll want not to replace line endings that are already correct, because you'd end up with a "\r\r\n" (bad).
$SomeVar =~ s{(?<!\x0D)\x0A}{\x0D\x0A}g;
Updates:
|
|---|