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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |