Re: [Code] Compiling

From: George Greer (
Date: 05/07/99

On Fri, 7 May 1999, Patrick Dughi wrote:

>This is as simple as it can get.
>if ($#ARGV != 0) {
>        die "Syntax: <file name>\n";
>open (BROKEN,"$ARGV[0]") || die "Error: File $ARGV[0] does not exist\n";
>  while(<BROKEN>) {
>    s/\r+//;
>    print STDOUT $_;
>  }

Nope, try:

        perl -p -i -e "s/\r+//;" *.[ch]

The 'i' is strictly necessary there but it's handy in case you want to make
a backup (-i.bak) or you're expanding the file in the process of the

>It was written to only strip one '^M' out, so it works best on new
>messages.  Of course, you can take a minute and strip em out by hand, or,
>if you're really lazy, just put it in a loop.

OasisOLC has the same problem.  There's a strip_cr() for that.

George Greer

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST