fork(1) download
  1. use strict;
  2. use warnings;
  3. use feature 'say';
  4.  
  5. my $bin_string = '10000111000011';
  6. while($bin_string =~ m/((\d)\2*)/g) {
  7. print "$1\n";
  8. }
  9.  
  10.  
Success #stdin #stdout 0s 6176KB
stdin
Standard input is empty
stdout
1
0000
111
0000
11