not surprising, you're not using strict or warnings, also the code doesn't compile, you have several typos and you're not copy/pasting well enough .... copy/paste from XML::Parser Tutorial
Comment on Re: Unable to print the line numbers at witch the element found in the xml doc