Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: finding number of contiguous letters

by blazar (Canon)
on May 23, 2007 at 20:33 UTC ( #617110=note: print w/replies, xml ) Need Help??


in reply to Re: finding number of contiguous letters
in thread finding number of contiguous letters

Well, just chain a map-based solution like "mine" with the usual grep-based "uniq" or absorb the latter into the map():

my %saw; my @parts = map { my $s=substr $str, $_, 3; $saw{$s}++ ? () : $s } 0..length($str)-3;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2020-10-21 19:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (223 votes). Check out past polls.

    Notices?