view perl-wc @ 7:6c212f9834b6 default tip

fix hg-browse
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 23 Nov 2020 14:07:02 +0900
parents 78df974566a7
children
line wrap: on
line source

#!/usr/bin/perl
use strict;
use warnings;
use Encode;

my $buffer = do { local $/; <>; };

my $strings = decode_utf8($buffer);

my $lines = $strings =~ s/\n/\n/g || 1;
my $chars = length($strings);
my $bytes = length($buffer);

print "lines: $lines\n";
print "chars: $chars\n";
print "bytes: $bytes\n";