Hi.

How can i have \r\n on my heredoc string when i run my script in linux?

my $text=<<"END";
This is one line
This is another one
Final line
END

When i print this var in my linux box, i get this:
"This is one line\nThis is another one\nFinal line"

However i want:
"This is one line\r\nThis is another one\r\nFinal line"


What's the best way of accomplishing this?

I know that i can $text=~ s/\n/\r\n/; but i think it must be a better
way...


Best regards,
David Santiago

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to