in reply to PAR: Variable %x will not stay shared

Apparently PAR wraps your script in a subroutine. I'm not sure if it stores it like that, but if it does, don't ignore the warning - this can be a potential problem.

see this explanation in the mod_perl reference. My preferred solution is to make the base script as short as possible and move all interesting code to a seperate module.

  • Comment on Re: PAR: Variable %x will not stay shared

Replies are listed 'Best First'.
Re^2: PAR: Variable %x will not stay shared
by QM (Parson) on May 25, 2006 at 21:00 UTC
    It seems to be more complicated than just "PAR wraps your script in a subroutine, and that's the source of the problem." If that were the case, then any program that uses the cache/closure idea should cause the warnings.

    The toy script in the OP generates the warnings, but another script where I did something similar did not.

    So I'll have to work up an example along the lines of the toy script, but doesn't generate the warnings, and show the minimum tweak that does generate the warnings. (Or some kind soul can chime in with a satisfying explanation.)

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of