Greetings,
I have written a basic word count script. It incoporates many options that can be used to determing a word, divied a word, remove punctuation, etc... It works, but I am afraid that its not efficient in one aspect.
As of right now, when a word is found in a document punctuation that appears at the beginning and end of the word can be removed. With the user define what punctuation they want removed in a string divided by a space.
#!/usr/bin/perl my $stripped = '" !'; my $word = '"Wilmer!"'; foreach my $punc (split(/ / , $stripped)) { #print "punc: $punc\n"; $word =~ s/^$punc//; $word =~ s/$punc$//; } print $word;
I want to know what other monks would do. What is the most efficient method that you can think of? Or perhaps lead me into the right direction, so that I can right the code myself because it is my project and not yours.
In reply to stripped punctuation by thealienz1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |