The solution is.....

Window NT doing strange things! When I wrote the script originally I ran it at home, however at work where I started to test it this morning, we have a Filewall and MS Proxy...

Even though the MS winsock proxy is supposed to deal with things transparently, it clearly doesn't work for processes running under CGI, probably a user/permission problem. Anyway when I run it under CGI Matt's LibXML waits around trying to access the external DTD, which it can't, so it gives up eventually - hence the minutes of waiting. If you remove the DTD then it runs just as fast as it does on the command line.

I now have to remove the DTD from the input XML files or make Matt's LibXML parser ignore the DTD (which is what I thought $xml_parser->load_ext_dtd(0); did), but I was wrong.

Many thanks to kappa, though it was the wrong suggestion, it did made me think external, and hence track down the answer!

I should have know that if it runs okay from the command line, but not CGI it almost certainly is a permissions problem....!

As ever thanks in advance......!


In reply to Re: Why so slow from CGI, but not command line? by ajt
in thread Why so slow from CGI, but not command line? by ajt

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.