diff options
| -rwxr-xr-x[-rw-r--r--] | challenge-024/duane-powell/README | 0 | ||||
| -rwxr-xr-x | challenge-024/duane-powell/perl5/ch-2.pl | 2 |
2 files changed, 2 insertions, 0 deletions
diff --git a/challenge-024/duane-powell/README b/challenge-024/duane-powell/README index 3445422743..3445422743 100644..100755 --- a/challenge-024/duane-powell/README +++ b/challenge-024/duane-powell/README diff --git a/challenge-024/duane-powell/perl5/ch-2.pl b/challenge-024/duane-powell/perl5/ch-2.pl index 8cb0bdd84d..8371c68aef 100755 --- a/challenge-024/duane-powell/perl5/ch-2.pl +++ b/challenge-024/duane-powell/perl5/ch-2.pl @@ -121,6 +121,8 @@ sub build { # Parse and count words in $f while (<$FH>) { + # substitue all non-alpha-numberic chars with space then split on space + $_ =~ s/[^a-zA-Z0-9]/ /g; foreach (split(/\s+/,$_)) { $word_count++; my $w = lc($_); |
