Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: symbols, scope, and mod_perl

by acanfora (Novice)
on Oct 01, 2012 at 10:42 UTC ( #996615=note: print w/ replies, xml ) Need Help??


in reply to symbols, scope, and mod_perl

Found: manipulations on the symbols under mod_perl are visible to all threads, therefore the pointer mess I am seeing. I should manipulate the thread main function scratchpad, instead of the symbol table, but I do not know how to achieve such a thing.


Comment on Re: symbols, scope, and mod_perl
Re^2: symbols, scope, and mod_perl
by Anonymous Monk on Oct 01, 2012 at 10:52 UTC

    Um, that sounds "fishy" :)

    Each thread gets its own symbol table, they don't share

      Furthermore each script running under registry gets its own namespace, ex
      ModPerl::ROOT::ModPerl::Registry::D_3a_ro_sham_bo_theEXAMPLEXPORTERtes +t::my_dirt_sneaky_object_reference
        You are right. To be more precise, I am actually allocating the object on thread symbol table, but under mod_perl objects in "main" threads functions are persistent between calls. So it gets messed on subsequent calls. To avoid this it is needed to use a lexical variable, that does not allocate on the symbol table. To achieve the same behavior as per cgi environment, I should manipulate what it is called "stack scratchpad", but I do not have such skills.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996615]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2014-09-18 03:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (105 votes), past polls