in reply to Re: Re: Character Count
in thread Character Count

Hmm, the return value of tr/// is discussed in Learning Perl under Transliteration, in Camel under the Regexp section and the tr listing in the function description section. It is described in perlfaq4 under the heading, "How can I count the number of occurrences of a substring within a string?", and in perlfunc tr.

How can you be upset that someone finally gave you a reason to learn something that is so fundamental that it appears in the FAQ and beginner's books? Your reaction is especially incredable considering that the tr/// solution actually directly answers the literal meaning of the question posed. Perhaps not every word in the question was to be taken literally, but that's not really something I like speculating on. Anyway, it's not like being forced to understand perlguts.


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein

Replies are listed 'Best First'.
Re: Re: Re: Re: Character Count
by Yendor (Pilgrim) on Oct 16, 2003 at 05:47 UTC
    How can you be upset that someone finally gave you a reason to learn something...

    I'm not upset at having learned something. That's never the case.

    As for it being covered in places A, B, and C...Well, I've probably read at least 2 of 'em over the years. I've worn out my magenta-backed Camel. Probably twice if it weren't for duct tape (and the blue-backed one I bought to replace it.) Doesn't mean I remember everything. Do you remember everything you've ever read? What do you get when you multiply six by nine?

    What I was requesting was more of an explanation. I've been using Perl for going on 8 or 9 years now. It's not my primary language, but even when I do use it, I rarely if ever need to use the tr/// operator.

    As I stated, I followed up on it, and learned something from it. I find that to be a good thing overall. That doesn't mean Abigail couldn't have given a quick one-line reminder of this side effect of the tr operator.

    Just MHO.