Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How can I count the number and kinds of letters at 1st, 2nd and 3rd positions of 3-letter words in a string?

by NetWallah (Abbot)
on Apr 25, 2012 at 15:41 UTC ( #967096=note: print w/replies, xml ) Need Help??


in reply to How can I count the number and kinds of letters at 1st, 2nd and 3rd positions of 3-letter words in a string?

Build and print a Hash of Arrayrefs like this:
my ($i,%x); $i=0; $x{$_}[$i++%3]++ for split //, $a; for my $k (sort keys %x){ my $aref = $x{$k}; print "$k "; print for @$aref; print $_; }
(untested)

             All great truths begin as blasphemies.
                   ― George Bernard Shaw, writer, Nobel laureate (1856-1950)

  • Comment on Re: How can I count the number and kinds of letters at 1st, 2nd and 3rd positions of 3-letter words in a string?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967096]
help
Chatterbox?
[ambrus]: (Alternately a deep source dive and then rewrite that event loop to make it better, and then as a bonus you get an idle method.)
[ambrus]: The 0.2 seconds wakeup is likely a workaround for some bug, but I can't guess what bug that is.
[ambrus]: It's been there since Prima 1.00 iirc
[Corion]: Hmmm... Weird. Maybe it needs that for doing its timers or something. Still weird.
[Corion]: But I guess I'll find out soonish, as my application seems to use Prima for more than just displaying the OpenGL output soonish ;))
[ambrus]: No, I think the timers are handled fine in the event loop, as far as I can see.
[Corion]: So far, I liked Prima quite well as it simply seems to do what I want even if it has an upside-down coordinate system. But it installs from CPAN out of the box and is cross-platform

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2016-12-09 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.