Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

regexp for scalar containing a mixture of LF & CRLF

by NateTut (Deacon)
on Dec 09, 2004 at 22:52 UTC ( #413710=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      open (TEXTFILE, ">$subdir/message.txt")
         or die "Can't create $subdir message file: $!";
    ...
      $doc->{Body} =~ s/\015/\n/gm;
      print TEXTFILE $doc->{Body};
      close TEXTFILE;
    
  2. or download this
      open (TEXTFILE, ">$subdir/message.txt")
         or die "Can't create $subdir message file: $!";
    ...
      $NewBody =~ s/\x0D\n/\n/g;
      print TEXTFILE $NewBody;
      close TEXTFILE;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://413710]
Approved by BrowserUk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2014-09-19 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (140 votes), past polls