Not sure if it will help you, but LWP::Simple seems to work ok.

D:\Perl\test>perl58 -mLWP::Simple=getprint -e" getprint 'http://xml.am +azon.com/onca/xml2?t=webservices-20&dev-t=D3N1ICFCFE4DHV&AsinSearch=1 +565924193&type=lite&f=xml'" <?xml version="1.0" encoding="UTF-8"?><ProductInfo xmlns:xsi="http://w +ww.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="htt +p://xml.amazon.com/schemas2/dev-lite.xsd"> <Details url="http://www.amazon.com/exec/obidos/redirect?tag=webser +vices-20%26creative=D3N1ICFCFE4DHV%26camp=2025%26link_code=xm2%26path +=ASIN/1565924193"> <Asin>1565924193</Asin> <ProductName>CGI Programming with Perl</ProductName> <Catalog>Book</Catalog> <Authors> <Author>Gunther Birznieks</Author> <Author>Scott Guelich</Author> <Author>Shishir Gundavaram</Author> </Authors> <ReleaseDate>15 January, 2000</ReleaseDate> <Manufacturer>O'Reilly &amp; Associates</Manufacturer> <ImageUrlSmall>http://images.amazon.com/images/P/1565924193.01.T +HUMBZZZ.jpg</ImageUrlSmall> <ImageUrlMedium>http://images.amazon.com/images/P/1565924193.01. +MZZZZZZZ.jpg</ImageUrlMedium> <ImageUrlLarge>http://images.amazon.com/images/P/1565924193.01.L +ZZZZZZZ.jpg</ImageUrlLarge> <ListPrice>$34.95</ListPrice> <OurPrice>$24.47</OurPrice> <UsedPrice>$13.99</UsedPrice> </Details> </ProductInfo>

I tried the latest version of your script you posted, and it too hung on the read from the socket. I can't see why either.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller



In reply to Re: Re: Re: Reading an XML page by BrowserUk
in thread Reading an XML page by Guildencrantz

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.