Re: Reloading perl file dynamically
- From: anno4000@xxxxxxxxxxxxxxxxxxxxxxx (Anno Siegel)
- Date: 31 Mar 2006 10:06:19 GMT
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.
.
- Follow-Ups:
- Re: Reloading perl file dynamically
- From: req
- Re: Reloading perl file dynamically
- References:
- Reloading perl file dynamically
- From: req
- Reloading perl file dynamically
- Prev by Date: Reloading perl file dynamically
- Next by Date: Re: Finding the number of occurences in an array
- Previous by thread: Reloading perl file dynamically
- Next by thread: Re: Reloading perl file dynamically
- Index(es):
Relevant Pages
|