Mercurial > hg > Members > anatofuz > anatofuz-tools
view perl-wc @ 4:c168b4b36ea3
add index.cgi.pl file
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 May 2019 06:36:07 +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";