Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Byte repetition check

by thezip (Vicar)
on Dec 11, 2014 at 21:17 UTC ( #1110103=note: print w/replies, xml ) Need Help??


in reply to Byte repetition check

Yet another WTDI:

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $data = '11122222344456788899'; my @data = split(//, $data); my $accum = {}; my @buffer = (); push(@buffer, shift(@data)); while (@data) { push(@buffer, shift(@data)); if($buffer[0] == $buffer[1]) { $accum->{$buffer[0]}++; } shift(@buffer); } print Dumper($accum);

*My* tenacity goes to eleven...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-10-14 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?