Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hopefully I properly qualified my comments since I tried to offer them as food for thought rather than some prescriptive set of requirements.

The pre-increment is a good suggestion, and aligns with a verb-object syntax nicely. I need to break that muscle memory.

The subject of the post agrees with your interpretation of the hash, but the usage runs counter. As soon as the goal becomes "How many times are words repeated?" the approach should have an accurate count in whatever stash you are using, as close to data as possible. Obviously the best answer is what you gave in Re: regex, find words that occur more than once., but subject to a homework-like requirement of use a regex a defined-or assignment keeps the store honest while still being reasonably succinct (and doesn't net add any lines). I'm not fundamentally opposed to communicating that the keys are the important thing, but especially when people are starting out, having the hash named after the property you are measuring (e.g., %count, %seen, %formatted) avoids %words, %others, %words2 anti-patterns.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


In reply to Re^4: regex, find words that occur more than once. by kennethk
in thread regex, find words that occur more than once. 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 having an uproarious good time at the Monastery: (7)
As of 2024-03-28 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found