Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Frequency Analyzer

by Chmrr (Vicar)
on Mar 16, 2001 at 06:27 UTC ( [id://64863]=note: print w/replies, xml ) Need Help??


in reply to Frequency Analyzer

Interesting that you should bring this up. In my "AP Computer Science" class (unfortunatly taught in C), the teacher promised that one of the harder projects later in the year would be to do this exact problem. Within 2 minutes I turned in the following code:

perl -ne 'chomp;$c{$_}++ for split//;}print map {"$_:$c{$_}\n"} sort keys %c;{'

..which is a cruder version of what you have above. Whenever I can, I enjoy putting pained looks on the other student's faces as I hand-write in pencil my code, whilst they print out reams of paper.. :)

 
perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-23 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found