Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I wrote a script that grabs a few blog RSS feeds and retrieves information about the most recent entry (title, pubdate, summary, etc). Today I noticed that the value of the title was "HASH(0x89c6a38)". I checked the xml source and noticed that the title was just "</title>".

What if statement would I use to check this value so that I can skip this entry should it happen again? I do not want to display any blog entries that have a missing title.

I am using XML::Simple for parsing the xml tree structure of the RSS feed.

Replies are listed 'Best First'.
Re: XML tag was empty - how to check?
by pjotrik (Friar) on Jul 23, 2008 at 21:31 UTC
    The SuppressEmpty parameter is used to control how empty elements should be represented in the structure created by XMLin. Set it to undef or '' - whichever is more suitable for you.
Re: XML tag was empty - how to check?
by GrandFather (Saint) on Jul 23, 2008 at 21:40 UTC