Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

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

Wow, thanks for all the tips! I was going to make a subroutine, just wasn't sure if I should put everything in it, or only the parts that were **exactly** the same, and then keep the if-elsif structure in the main script. I think I'll stay away from the advanced stuff for now, I think I should learn OO first.

Regarding @matches, I need all the elements pushed to that array to stick together. They will be outputted together. There will be some duplicate values, but after looking at the code, I think it will still be okay to use a hash...

My diagnosis: since @matches will be over-written, duplicate key-value pairs in the matches will still be kept in @all_matches. (ie. different sentences mathed have 3 of the exact same elements in @matches, but it shouldn't matter). I will have to try and see

I need to then sort all the @matches by different criteria ( frequency of matches with the same grammar relation, arg1 and arg2 (which are 3 elements of the 6 in @matches)). Which is why I used @all_matches. So I thought ordering was important. But after reading the Uniqueness of hashes, I may be able to utilize some of those counting duplicate methods. Thanks a lot!

Just writing this reply sorted some things out in my head...

Aside: Can I reward good answers on this site?

In reply to Re^2: How to implement a Design Pattern/ Strategy?? by jonc
in thread How to implement a Design Pattern/ Strategy?? by jonc

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: (6)
As of 2024-04-19 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found