Hello

They're your research questions, not my research questions, so I'm not going to give you a straight answer. Sorry, but I hope you'll find the following useful.

Question 1: take a look at the Perl FAQ section discussing finding unique elements in a list, and the subsequent section on "How can I tell whether a list or array contains a certain element?". The good authors of the document say:

Hearing the word "in" is an indication that you probably should have used a hash

Question 2: Try following the function calls through. The first function that gets called is DoSomething, and the argument it gets passed is the big long string about "Bradburn vs Harris". The functions do some stuff manipulating the strings with regular expressions, and those hashes turn up again with functions like exists. Try reading up on these.

You could try running the program too, assuming you trust the person it came from. I'll give you a clue too, it won't do anything harmful to your PC. You could install Perl, save the program in a file and run it to see what happens. You'll need to correct a typo in the line sub StripWhiteSappace, and you might add a DEBUG function to follow what's going on.

HTH
ViceRaid


In reply to Re: Perl junior entreats monastery for course help by ViceRaid
in thread Perl junior entreats monastery for course help by spyder78

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.