Typically I look at the warnings and errors and fix any problems until the code will run. Then I look at the output to see if I'm getting the expected results and make changes and read the documentation for any modules or functions that aren't working like I expect. I also put in extra print statements to test my assumptions of how the code should work.
The code I posted has a missing parenthesis but otherwise does what you requested. The second warning message points you to the exact line where this occurs.
syntax error at C:\b\perlmonks\xml\1029217.pl line __, near "){"In reply to Re^4: perl & XML: getting last child?
by Lotus1
in thread perl & XML: getting last child?
by ambrill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |