[ic] eBay UserTags Update

Kevin Walsh kevin at cursor.biz
Tue Mar 23 06:58:20 EST 2004


Grant [emailgrant123b at yahoo.com] wrote:
> I posted 4 eBay UserTags a little while back and this
> change affects all of them.  If anyone is using any of
> those tags, change the following line:
> 
> if ($response) {
> 
> to this:
> 
> if ($response =~ /^<\?xml/ ) {
> 
> That should prevent a non-XML response from crashing XML::Simple.
> 
I just had a look at one of your old articles (14 November 2003) and
your UserTag is doing this:

    my $response = $request->content();

Perhaps it would be a good idea to do something similar to this first:

    die 'Goodbye cruel world' unless $request->is_success();

You don't have to "die", of course, but doing some error checks should
help you to avoid non-XML responses.  See LWP::UserAgent for more
information on how to show the specific error messages etc.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list