in reply to Re^2: Replacing duplicate string
in thread Replacing duplicate string

It prints to STDOUT instead of inline editing, but that's an easy redirect. Otherwise, it works just fine on my end.
-----
"Ask not what you can do for your country. Ask what's for lunch."
-- Orson Welles

Replies are listed 'Best First'.
Re^4: Replacing duplicate string
by lostjimmy (Chaplain) on Apr 15, 2009 at 19:24 UTC

    I'm sure it compiles just fine, and it does actually run, but I would have to say that you didn't actually run that code on your end, otherwise you would have seen that it doesn't run 'just fine'.

    You need to move the declaration of $do_mod outside of the loop for it to run just fine.

      Fair point. Grabbed the wrong block of test text, so gave the appearance of correct output text.

      Another point: one might find better reception to suggestions sans snark.
      -----
      "Ask not what you can do for your country. Ask what's for lunch."
      -- Orson Welles