Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: hash to differentiate type and tokens

by johngg (Canon)
on Jul 13, 2011 at 11:08 UTC ( #914098=note: print w/replies, xml ) Need Help??


in reply to hash to differentiate type and tokens

I'm guessing as well but do you mean something like

knoppix@Microknoppix:~$ perl -E ' > $str = q{finding related pages on the world wide web the web}; > $hash{ $_ } ++ for split m{\s+}, $str; > printf qq{%-10s - %d\n}, $_, $hash{ $_ } > for sort keys %hash;' finding - 1 on - 1 pages - 1 related - 1 the - 2 web - 2 wide - 1 world - 1 knoppix@Microknoppix:~$

I hope I've guessed correctly and that this is helpful.

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2023-12-10 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (39 votes). Check out past polls.

    Notices?