in reply to Error while parsing an XML file using XML::LibXML ...

Seeing as findnodes has absolutely no idea whether the string you gave it was hardcoded or not, and since you claim that is the only difference, that leaves only one possibility: You're passing a different string than the one you had hardcoded.

Most likely, the variable to which you alluded doesn't contain what you think it does. But since you provided no code, there's no way to know.

Replies are listed 'Best First'.
Re^2: Error while parsing an XML file using XML::LibXML ...
by biswanath_c (Beadle) on Oct 15, 2009 at 01:50 UTC
    that's the weird part! I understand your comment; but I printed out the variable just before calling findnodes (the line of code that breaks) - it's EXACTLY the same as the hard-coded value that I tried in find nodes which succeeds! I know it sounds weird, but that's why i am confused too!

      Either it isn't exactly the same (trailing whitespace?) or something else is different.