where \r is a carriage-return and \n is a line-feed. This code will convert every type of line ending to a CR-LF pair.$str =~ s/(\r\n|\n\r|\r|\n)/\r\n/sg;
Update: removed parenthesis from replacement text
In reply to Re^3: problem with 'bare LF' in script
by monarch
in thread problem with 'bare LF' in script
by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |