#!/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"; my @words = split( /\W+/, $string); #### my @words = /\w+/g; #### print "Word count: ", Dumper(%count); 1;