in reply to search and replace weird output

The lines you read in from the file have a trailing newline char (\n), don't they? If so, a newline char is a particular bad choice for a placeholder.
Anyone who can help me answer this question will help save my sanity.

Help yourself, by introducing copious debug print statements after each substitution. If you are a candidate for going insane over those kinds of problems, solving the problem for you would only delay your fate. Sometimes the only way to get out of peril is going through it... ;-)

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: search and replace weird output
by bluethundr (Pilgrim) on Feb 25, 2008 at 23:00 UTC
    Help yourself, by introducing copious debug print statements after each substitution. If you are a candidate for going insane over those kinds of problems, solving the problem for you would only delay your fate. Sometimes the only way to get out of peril is going through it... ;-)

    Heh...point well taken sir! Actually the "answer" in the back of the book suggests using the \n as the placeholder. So, you're issue is with Randal, not me! ;)
      Ah, no. I don't have an issue, with neither you nor Randal. But Randal cared to chomp or chop, didn't he?

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}