in reply to Re: Tell whether two strings differ at only one position
in thread Tell whether two strings differ at only one position

This is what I wanted to do myself in the first place. Only that... I plainly didn't remember about the /c switch! And I tried with the /d one (without assignment, that is) but it failed like this:
Can't modify bitwise xor (^) in transliteration (tr///) at foo.pl line + 7, near "tr/\0//d) "
So I adopted a temp variable. Incidentally I wonder why I don't get the same error if I omit /d (with or without /c)... in both cases I'm attempting at modifying it, am I not?

Replies are listed 'Best First'.
Re^3: Tell whether two strings differ at only one position
by BrowserUk (Patriarch) on Aug 05, 2005 at 09:31 UTC

    With /d and /c, you are modifying the string.

    Without either, and with source & destination tables being the same, is a special case designed for counting only.

    There would be no point in modifying the string just to replace like with like.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.