What is this the spanish inquisition?

The dude asked for the two values to be retrieved and sent to a function called data_transform the results of which get printed out.

He didn't specify what data_transform does with the two values and his example appeared to be very simplified, because I sincerely doubt the real task is actually about multiplying letters by a given number.

What stumped me about your solution was that I found no mention at all of the function data_transform, and I had to use knowledge and understanding of perl object orientation to actually read the code and figure out what it does.

Your solution uses this bit of code :

$node->appendText( $node->textContent() x (shift(@counts) - 1) );

To multiply the letters by the numbers as per the example, which as I mentioned appeared to be over simplified and not real world.

Now my point is this; the guy asking the question is obviously a real beginner who probably doesn't understand object orientation and its notation, and was asking for a simple method to strip out the values and send them to a specific function.

Your example obviously works and does what he actually asked for, but you completely failed to recognise that what he asked for was probably not what he really wanted, and as a result you created this over-engineered verbose solution which is in all likelyhood way too complex and reliant on advanced perl programming techniques for the guy to actually be able to make any use of it.

If an 8 year old asked me what the government is, I would tell him its the people that everyone has chosen to decide how to run the country. I wouldn't give him a 2 hour lecture on party politics, law, and history because most of it would just go straight over his head.


In reply to Re^14: Processing Two XML Files in Parallel by Logicus
in thread Processing Two XML Files in Parallel by tedv

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.