You know, there have been several discussions as to wether this really is more system-independent than, say, /usr/bin/perl is and basically it's very much like a flame war. This is not terribly perl-specific, but sometimes it comes around...#!/usr/bin/env perl
Goood!use strict; use warnings;
Well, no harm done, but split is for... ehm... splitting. Here rather than matching on non-words to discard them you may want to match on word to gather them":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;
<SNIP>Huh?!? This is not needed, by any means. It's used in modules - for a well defined reason, not relevant here. Yours is simply a script...print "Word count: ", Dumper(%count); 1;
All in all, well done!
In reply to Re: Word incidence count
by blazar
in thread Word incidence count
by redhotpenguin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |