in reply to In-Place Edit - Null Characters

Perl stops reading the file at the first ^Z character, because -i.bak-Mode does not enable binmode. The following oneliner should work:

perl -i.bak -e "BEGIN{binmode STDOUT}" -p test.pl adp.rsf

As you don't post any code, it's hard to give you a more elegant version though.

Replies are listed 'Best First'.
Re^2: In-Place Edit - Null Characters
by ikegami (Patriarch) on Dec 23, 2005 at 05:54 UTC
    You need to binmode STDIN too!
Re^2: In-Place Edit - Null Characters
by Anonymous Monk on Dec 23, 2005 at 00:36 UTC
    Thanks for the quick response. I tried your suggestion, but got the same result where only a few of the (jibberish) characters were returned, ÐÏࡱ

    I didn't post the contents of test.pl because it can really be anything. The real code will does a substitution for host name and IP after it gets past (supposed to get past) the header, but for the test I just have rem statements in test.pl since it is my understanding that the command line does the while <> operation and print loop.

      If you know its not test.pl then what is it? Realy, honestly, post the code so we can help.


      ___________
      Eric Hodges $_='y==QAe=e?y==QG@>@?iy==QVq?f?=a@iG?=QQ=Q?9'; s/(.)/ord($1)-50/eigs;tr/6123457/- \/|\\\_\n/;print;
        Here you go...Content of test.pl

        #
        Content of Test.pl:

        #