in reply to Change utility; code optimization

perl -n -e 's/\r$//;print "$_";' flange.txt > op

works just fine for removing the ^M from flange.txt, I could not spot in your code where you were trying to do the ^M translation. As to how to how to imporove it generally. I will get back to ya on monday, sorry but it is my home time now.
HTH (a bit)
--

Zigster

Replies are listed 'Best First'.
Re: Re: Change utility; code optimization
by yakko (Friar) on Feb 10, 2001 at 00:13 UTC
    How about:
    perl -ne 'tr/\r//d;print;' flange.txt > op

    --
    Me spell chucker work grate. Need grandma chicken.

      </code>perl -pi.bak -e 'y/\r//d' flange.txt</code>

      Generally, when you see -n and ;print' in a one liner, think -p and hug a camel. =)

      --
      $you = new YOU;
      honk() if $you->love(perl)