perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: ScratchPads
Date Thu, 16 Mar 2000 00:00:47 GMT
If you check out my ftp site ( and download
the source archive in there, there is a really decent scratchpad
parser in there.  Its really not that difficult of a setup, this is
sort of OT, but here goes.

Here is how it works.  Each CV (Code value) has a AV (Array Value)
that contains other AVs.  The first "level" of AVs contain the
"common" name of the variable i.e. $sth, etc.  The second array in
that scratch pad array is the first level of recursions values.  Third
array is the second level of recursion, and on and on it goes.

Here is where I'm going to make it on topic ;-).  If you're using
recursive algorithms within your modperl programs... this is NOT a
good thing.  You see modperl has no way of recollecting that memory,
and each thread of apache will carry that "bloat".  However if you
must use recursion, I would HIGHLY HIGHLY reccomend using references
instead of actually passing the values, this is the only decent way to
have any sort of performance, and reasonable memory consumption.

If you want more information on this topic send me an email..., also
Malcolm Beatties treatment of this in "Advanced Perl" is an absolute
requirement.  Also there is a module put together by..., arg, I can't
remember, it's the lady that always tangles with Tom Christiansen on
comp.lang.perl.  I believe it's Data::Dumper.  The algorithm I use in
my source tree of matofali is based on that module.

Have fun... the internals of perl are not well documented and
generally a pain in the arse, but it's definetly an interesting read.


(BTW: Chris I don't know what you're planning to do with this, but the
algorithm in matofali is designed to manually clear the scratchpad
between execution cycles..., though you should ignore the throttling
code in there, it's a bit too complex and I've been meaning to clean
it up.)

On Thu, Mar 16, 2000 at 12:21:33AM -0500, Chris wrote:
> Is there any simple (as easy as getting to the symbol table) way of
> dumping the contents of the current scratchpad? I'd like to dump a list of
> lexical variables in use and their values but am having a hard time
> finding out how it's done (if at all).
> --Chris

View raw message