Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Byte repetition check

by thezip (Vicar)
on Dec 11, 2014 at 21:17 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1110103]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found