dos - say with \n\r newline with Perl -


i use say dos newline format:

say "foo" should display foo\r\n

i tried redefine new line variable doesn't change anything

 local $/="\r\n";  

another solution manually write:

 print "foo\r\n";  

but not convenient

don't use global vars affect handles; use

open(my $fh, '>:crlf', ...) 

or

binmode($fh, ':crlf') 

:crlf added default on windows machines, specifying in open or trying add handle has using binmode won't hurt.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -