#!/usr/bin/perl use Encode; use utf8; $count = 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 "…") { $count++; } } print "$count\n"; $count = 0; }