cleanup and fixes

Hey there, I minimized some of the code you wrote.  I also made some lines more defensive to avoid undef errors.  One change I made that you may or may not like is that get_links_from_xml now returns an array ref instead of the entire array element.  I also modified the calls in your readme.pl.

Anyway, I hope you find the change useful...It's a bit easier to read now. :)