in reply to Efficient run determination.
Interesting problem, BrowserUk!use strict; my $string=" aaaa bbbbccccccccbbbb aaaabbbbbcddddddddddddddddd +dddd"; my @listedstring= split//,$string; my $prev=shift @listedstring; my $currstart=my $index=0; for (@listedstring) { if ($_ eq $prev) { $index++; } else { print "('$prev',$currstart,".($index-$currstart+1).")\n"; $currstart=++$index; $prev=$_; } } print "('$prev',$currstart,".($index-$currstart+1).")\n";
CU
Robartes-
|
---|