Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: What is the difference?

by dakkar (Hermit)
on Apr 08, 2003 at 18:02 UTC ( #249025=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: What is the difference?
in thread What is the difference?

Your tr (the program) example does, indeed, get rid of non-whitespace. The Perl program, howver, does not. What it does is: take all characters but some whitespace (those with ASCII codings 32, 9, 13, 10, in order), changing them with themselves, and returning how many have been (non) changed.

The /c option complements the first list of tr///, while leaving the second list empty makes it equal to the first (in this case, the complemented first). tr/// in any case returns the number of characters interested by the transliteration.

-- 
        dakkar - Mobilis in mobile

Most of my code is tested...


Comment on Re: Re: Re: What is the difference?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://249025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2015-07-04 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls