http://www.perlmonks.org?node_id=829580


in reply to Use of uninitialized value in string comparison (cmp)

Firstly - I think it is better to isolate and _minimize_ the problem definition; shorter and indented XML document might be better for reading. My experience is that I often solve my problem when I minimize it...

Secondly - I GUESS that you try to sort elements which do not have attribute "type".

  • Comment on Re: Use of uninitialized value in string comparison (cmp)

Replies are listed 'Best First'.
Re^2: Use of uninitialized value in string comparison (cmp)
by bharathinc (Novice) on Mar 19, 2010 at 11:14 UTC

    Thanks a lot to every one. I got an hint now to solve this. Sorry about sending a big xml DATA, I was not getting this error when it was few lines of XML. I got the errors only when it was a big xml. In future I will try to send the indented xml. Thanks again to all.

      bharathinc:

      Yes, that's why pajout mentioned the tip on minimizing your code example. You'll find that while minimizing your code to the minimum case that shows the fault, you'll usually find the line(s) of code or data that exhibit the problem. Once you know those few lines, the error frequently sticks out like a sore thumb. So you get the answer quicker, and learn faster to boot.

      ...roboticus