in reply to Hash element exists/delete
While there are a few interesting topics, no-one has mentioned that the easiest way to remove the upper-case characters is not to have any in the first place:
my %H; while (<>) { my @words = map { lc } # map all words to lower case split /\s+/, $_; # break $_ into a list of words $H{$_}++ for @words; # add words to hash }
If you needed the upper-case versions at some point, then this may not be useful. But people frequently miss the opportunity to clean up the data before storing it, so I thought I'd mention it, just in case.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash element exists/delete
by tmharish (Friar) on Jan 22, 2013 at 11:16 UTC | |
by roboticus (Chancellor) on Jan 22, 2013 at 12:56 UTC |