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

I don't think that code does what you think it does.

Replies are listed 'Best First'.
Re^3: Replacing duplicate string
by apok (Acolyte) on Apr 15, 2009 at 19:16 UTC
    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

      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