Code:
#/usr/bin/perl
use strict;
use warnings;
# Setup the counters
my $shed_counter= 0; # question mark counter
my $doubleshed_counter = 0; # period counter
my $ga_counter = 0; # comma counter
# Open a file
open(FILE, "world affairs.txt");
# Process the file
while(<FILE>)
{
if( $_ = m/\།/)
{
$shed_counter++;
}
if( $_ = m/\།+/)
{
$doubleshed_counter++;
}
if( $_ = m/\ག/)
{
$ga_counter++;
}
}
print("Number of question marks: $qm_counter\n");
print("Number of commas: $comma_counter\n");
print("Number of periods: $period_counter\n");
i want to count the follow three characters
1)།
2)ག
)།།
is it possible??
thanks
chungku
ག
Comment