charcount Script
#!/usr/bin/perl -w
 
use strict;
 
print "(Use CTRL-D to quit)\n";
print "Enter strings to count characters:\n";
 
while (<>)
{
   chomp;
   my $str = $_;
   my $len = length $str;
   print "\"$str\" = $len chars\n";
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License