Beefy Boxes and Bandwidth Generously Provided by pair Networks
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, Richard
I 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:
How to RTFM
On asking for help
Don't just provide a module name

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"


In reply to (crazyinsomniac) Re: Excluding words with more than three a by crazyinsomniac
in thread Excluding words with more than three a by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found