Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: Removing carriage returns from source code

by Anonymous Monk
on Nov 03, 2001 at 06:29 UTC ( #122991=categorized answer: print w/replies, xml ) Need Help??

Q&A > CGI programming > Removing carriage returns from source code - Answer contributed by Anonymous Monk

It might be those annoying ^M's.
<CODE>
#!/usr/locl/bin/perl

while(<>) {
s/\cM//g;
print;
} <CODE>
~
:w no_cM.pl
% ./no_cM.pl < annoying_file.txt > ahhh.txt

  • Comment on Answer: Removing carriage returns from source code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2020-09-24 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (132 votes). Check out past polls.

    Notices?