in reply to Word incidence count

#!/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;
Update: forgot the case-insensitiveness and changed the string to upper case

$\=~s;s*.*;q^|D9JYJ^^qq^\//\\\///^;ex;print