"Demetrios C. Christopher" wrote:
> 
> By the way, have you ever considered adding a pre-parsing
> step where you first read in all the subroutines separately
> (say, up to the first line of code) and place them before
> the actual subroutine that will become main and will denote
> the script itself?  That could be a life-saver!  I believe
> that's how the ATG-Dynamo people did it... Dynamo is a Java
> (no booing please) -based app server where the scripts
> (identical to jsp's) are precompiled as their own "classes"
> and then executed.  In their case I believe they do that
> preparsing I mentioned except that in Java I don't think
> it makes much of a difference! Oh well, Perl : 4654574,
> Java : 1 !
> 

I don't think I would be able to successfully parse out
subroutines without writing a complicated parser, but its
an interesting idea.  I could have the UseStrict setting
trigger an error_log warning recommending to move subs 
to a perl library possibly if I find a \nsub\s+\w+\s*{\s*\n 
kind of expression in the ASP perl code.

> I hate to digress again but although I understand the
> "closure" deal, why does it persist?  In one execution I
> understand having that problem of not refreshing the
> value but why in subsequent executions as well?  Shouldn't
> those values disappear by that point?  I had it where I
> was adding elements to an array in the $arr[$#arr] fashion
> and if I pressed the refresh button fast enough the array
> would grow in size by the size of the original array!  I'm
> pretty sure what server thread you're on makes a difference.
> So if you have three threads with the underlined being the
> active one here's what would happen to the array size if I
> added ten elements to $arr by saying $arr[$#arr] = x

The problem/benefit of mod_perl is that things persist so
variables don't get cleared, and my closures don't get 
recompiled.  Your array growing problem sounds like one
that "use strict" programming will take care of because
if you initialize your array with my @arr; then it should
be cleared just fine every script execution.

--Joshua

Reply via email to