I tried what I could of your code. First, it's not clear to me what you intended with your double quotation mark in the s/// function. Was it your intent to replace quotation marks by "-eee-"?

When I ran it both ways (printed to STDOUT and to a file), the results were the same - the substitution was performed, and I got "-eee-" both on the screen and in the file

My guess is that you've somehow eliminated the bug while trying to show us the problem. See if you can come up with a short script that cuts out all the unnecessary stuff, but that still produces the bug.

I've found that most of the time, when I try to reduce the code to the bare minimum that still has the bug, I wind up figuring out what the problem is myself - the bug suddenly shows up very clearly, once all the other stuff has been removed.

Finally, when you're showing code, use the <code> tags. They automatically format the code into legible form.


In reply to Re: substitution doesn't work properly? by spiritway
in thread substitution doesn't work properly? by myggel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.