laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Some monks have smelled homework ...
Hi Monks, I believe this is a simple question, but I ran in troubles when I tried to resolve it. Here is the problem: I've a list of words (a dictionary), and I need to exclude from it all the words that have more than three a, or more than two b, or more than two k. How can this be done? Many thanks for any advise. Best regards, RichardI did not like this post because when I read "this is a simple question" and "I ran in troubles when I tried to resolve it" all I can respond with is "liar liar, fingers on fire". As this is a site for "learning" perl, and enhancing your skill, after I see "How can this be done?", my first thought is "write a program", immediately after which I think "using perl" and then I think of a couple of potential strategies in non specific programming terms (pseudo code) and then I think in terms of accomplishing this with perl. Since you don't even attempt to solve the problem, and you do not seem to be able to express your problem in programming terms, I assume this is a homework question (since practically nobody who is very new to perl would come up with such a problem for themselves to solve). I sincerely doubt you even know how to write a simple "Hello world" program. I may be wrong, and surely if I am, i'd like you to tell me. I dont think I am, but it could be the case that your question asking strategy might be a little flawed or whatever. Some monks replied the way I would've (if I they didn't) with some reading material, giving you everything you needed to know (strategy, functions, everything) without literally writing the program for you. This is good, this is good advice. You say "Many thanks for any advise" which makes me a little sad because you cannot effectively get any advice that will do you any good (you might get a solution, but I seriously doubt it would do you much good). Judging from the way you asked your question, you'll just grab a working solution without knowing how or even why it works. This is not learning. If you truly wanted to learn, you would've (should've) described a what strategy you tried using to solve your problem that failed you, so that someone can help you with appropriate advice (maybe you had a poor strategy, didn't know how to use a certain function or what have you, didn't know the syntaxt for ...). I hope you read this and rethink how you'll ask the question next time.
Here are a few links I think everybody shold visit: In reply to (crazyinsomniac) Re: Excluding words with more than three a
by crazyinsomniac
|
|