#!/usr/bin/perl use Encode; use utf8; $count = 0; $tmpcount = 0; $temp =0; binmode STDIN, ':encoding(utf8)'; #binmode STDOUT, ':encoding(cp932)'; #binmode STDERR, ':encoding(CP932)'; while () { my $text = $_; my @te = split(//, $text); foreach my $tepart(@te) { if ($tepart eq "…") { if (($tmpcount+1) eq $temp) { $count++; } else { $count = 1; } $tmpcount = $temp; } $temp++; } print "$count\n"; $count = 0; }