On Thursday 21 March 2002 16:59, you wrote:
> >You're right, I was trying to figure out what's wrong and I left exec
>
> `thaw.pl`;
>
> >Here is the siuation:
> >the following script reads the log file and starts the other scripts.
>
> Most of them need the same data from the database.
>
> >I'm trying to avoid running database queries again and again by storing
>
> the query result in the hash table, freezing the hash and using the data
>
> >in the child processes after thawing it.
>
> I can think of a couple of approaches you might want to think about.
>
> 1. Run all of the other scripts in the same process as the original
> script, e.g. convert the other scripts into modules and use them in the
> main script. All of the code can then share the same memory.
> 2. Use the store/retrieve functions in Storable. They are analogous to
> freeze/thaw, except that they serialize/deserialize to the filesystem
> instead of memory. You can easily pass data structures from between
> scripts/processes this way.
>

Thanks a lot, Tim. I was sure that freeze/thaw is like store/retrieve  with 
an exception that the data is stored in memory instead of in the file and I 
can get the data inside the child process just by thawing it. I'll have to 
use store/retrieve functions because I don't have experience in converting 
scripts into modules. Well, maybe it's a good time to start gaining this 
experience.
Again, many thanks.

Greg
> There are probably other ways to do it that I didn't think of.
>
> Tim
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to