[San-Diego-pm] module idea

Daniel Risse dan at tierra.net
Tue Oct 3 18:23:32 PDT 2006


I must admit, I was also caught up with inspiration after seeing 
Damian's talk.  Specifically, seeing source filters gave me a cool idea 
to combat something I have been annoyed with for a while now.

I spend a lot of time writing for a mod_perl web server.  I read and 
have done a few tests to see that importing symbols can take up 
unnecessary memory.  My tests showed about 100k for each symbol imported.

Now it's not difficult to load a module and make fully qualified calls 
the functions it provide, but it's annoying.  Well, after a bit of 
tinkering this afternoon, I have a functional prototype to make this 
more efficient, and still the same ease of use.

For example, you could write code like this:

use absolutify;
use Readonly qw( Readonly );
Readonly my $FOO => 1;

And the absolute module would install a source filter, so what would be 
compiled would instead be:

use absolutify;
use Readonly ();
Readonly::Readonly my $FOO => 1;

I believe this should be pretty handy and easy to use.  The interface 
certainly seems sufficiently advanced.  What do people think about this 
idea?

Dan


More information about the San-Diego-pm mailing list