I already answered this question at your other thread. This node is basically a repost with a broken version of the code I provided. But you didn't give me a chance to respond to the original post.

Why did you remove the parentheses in the if block? The anonymous poster already pointed out the error. Some basic perl tutorials will help you with syntax.

When you post questions like these you need to tell us what warnings and errors you get and where you are stuck. Telling us that something doesn't work just means you expect us to do everything to debug "your" code.

You don't need both the -w after perl and use warnings;

Why not test your code with several cd/artists in the xml file, some empty and some with values?


In reply to Re: xml - empty node by Lotus1
in thread xml - empty node by ambrill

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.