#!/usr/local/bin/perl use Benchmark; $t0 = new Benchmark; for (my $x = 0; $x < 500; $x++) { my $numb = 1; for (my $x = 0; $x < 10; $x++) { my @numb = split(//, $numb); my $count = 1; my $newnumb = ""; for(my $x = 1; $x <= length($numb); $x++) { if ($numb[$x-1] ne $numb[$x]) { $newnumb .= "$count$numb[$x-1]"; $count = 1; } else { $count++; } } $numb = $newnumb; } } $t1 = new Benchmark; $td = timediff($t1,$t0); print timestr($td), "\n";