From: Benjamin Hepp Date: 2005-07-02T20:10:45+09:00 Subject: Re: Loading a file without cluttering the global namespace On Sat, 02 Jul 2005 19:30:25 +0900, Austin Ziegler wrote: > Not cleanly. There's a few examples of wrapped loads that allow you to > load into a random namespace; I've done one myself as a theoretical > example. Where can I find those examples? I don't know what to search for. > What problem are you trying to solve? There might be another way. Well I want to write a FastCGI-Server in ruby. Depending on the queried website it should load the specific ruby-file based on some pattern. When I now have a file using GD for example, the loaded GD.so would hang around all the time. If I changed the file so that it wouldn't use GD anymore I would have to restart the server so that GD.so doesn't lie around in the memory forever (until the next reboot at least). Starting a new ruby-interpreter for every file isn't an option because it would take to long. Writing the FastCGI-Server in C isn't an option as well because when I initialize the ruby-interpreter (ruby_init()) a second time, all loaded files are still available to the interpreter. Otherwise I could have reinitialized the interpreter every few hours or so. Benjamin Hepp