Update: forgot the case-insensitiveness and changed the string to upper case#!/usr/bin/env perl use strict; use warnings; use Data::Dumper qw( Dumper ); my $string = "Hello World!\n Oh poor Yorick, his world I knew well ye +s I did"; # No change up to here # then just map ++$_,@count{split /\W+/,uc $string}; # that's it print "Word count: ", Dumper(%count); 1;
In reply to Re: Word incidence count
by Skeeve
in thread Word incidence count
by redhotpenguin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |