Re: Reloading perl file dynamically



req <reqvidd@xxxxxxxxx> wrote in comp.lang.perl.misc:
Hi,

First of all, here's my problem:

I have to parse a huge XML file and then run several tests on it.
The loading can take several minutes, and the tests I run I change all
the time.
So what I want to do is to keep the parsed XML in memory, and then keep
the tests in a separate file that I reload every time I have changed
any tests. Then the XML parsing is only done once for a set of tests.

I thought I could achieve this with Module::Reload, but I doesn't work
for me. It reloads the file if it has changed on disk, but I can't see
that the code changes gets reflected...
So I resigned to "do FILE". This works, BUT

Scary stuff happens. I have done quite some debugging and I can't
understand what is going on. Every second time I run the tests (on the
previously parsed XML) a specific "while-loop" over a regexp is not
matching. And it's clear what is supposed to match is really there. So
I run the tests again, and suddenly it works. And the next time not,
and so on. It's really spooky.

So what is the specific loop that gives you trouble? We can't
debug code we don't see. Reduce the problem to a small program
that we can run and post that. Unless you find the problem in
the process, that is.

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
.



Relevant Pages

  • Reloading perl file dynamically
    ... I have to parse a huge XML file and then run several tests on it. ... that the code changes gets reflected... ... I don't feel comfortable with the do FILE since the file I'm loading is ... Are the Reload really meant ...
    (comp.lang.perl.misc)
  • Re: parsing to XML
    ... Generating XML from the hash is probably a job for one of the XML modules. ... "Reply" at the bottom of the article headers. ...
    (comp.lang.perl.misc)
  • Re: best way to do a ticker?
    ... Data source can be XML (amongst ... It will read from an XML file, ... > display it at the bottom of my page going to the left side coming from the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Repetitive XML comments -- whats the point?
    ... public void RemoveNode{ ... isn't obvious by the method's name, then the method should have an XML ... and serve no purpose but to cause real code to scroll ... off the bottom of the screen. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: titles
    ... the Subtitle Animation does that, when you opt for left justification, and ... website references are to www.papajohn.org ... bottom of the screen and just tells who someone is and what they do, ... I'm sure there's some way to do it with XML or something like that, ...
    (microsoft.public.windowsxp.moviemaker)