Did you add the use strict line to your text before posting so you wouldn't get yelled at? Because there is no way that this code will run under use strict with 40 odd undeclared variables.
UPDATE: In fact this is the same code you posted last week without the use strict line. Aristotle nicely replied with a well written revision that compiles under strict and fixes a lot of the glaring propblems, which you have apparently ignored.
Now you post the same bad code, with a use strict thrown in just for our benefit and expect us to fix it again. I would suggest that you go back and apply the changes that Aristotle and others took time out to show you instead of wasting your own and everybody elses time.

-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

In reply to Re: Replacing a ' in a string by dreadpiratepeter
in thread Replacing a ' in a string by SamueD2

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.