Help for this page

Select Code to Download


  1. or download this
    $ perl -e'$x="1 2 3 4 5 5 5 5 5 5"; $counts[$1]++ for $x=~/(\d)/g; pri
    +nt "$_ $c
    ounts[$_]\n" foreach (0..$#counts)'
    ...
    3
    4
    5 10
    
  2. or download this
    $ perl -e'$x="1 2 3 4 5 5 5 5 5 5"; $counts[$1]++ while $x=~/(\d)/g; p
    +rint "$_
    $counts[$_]\n" foreach (0..$#counts)'
    ...
    3 1
    4 1
    5 6
    
  3. or download this
    $ perl -e'$x="1 2 3 4 5 5 5 5 5 5"; $counts[$_]++ for $x=~/(\d)/g; pri
    +nt "$_ $counts[$_]\n" foreach (0..$#counts)'
    0
    ...
    3 1
    4 1
    5 6
    
  4. or download this
    $ perl -e'$x="1 2 3 4 5 5 5 5 5 5"; $counts[$1]++ while $x=~/(\d)/g; p
    +rint "$_ $counts[$_]\n" foreach (0..$#counts)'
    0
    ...
    3 1
    4 1
    5 6