Here's an application of a problem-solving strategy I've found to be occasionally helpful
Interesting how this question came up right after one4k4's concerning a similar issue; long story short, your whole script is a subroutine when you run it under Apache::Registry. 'Course, you're getting it because you have a nested sub the way you've coded it anyhow. But back to the strategy outlined above =>
From perldoc perldiag the solution to the "won't stay shared" issue is:
This problem can usually be solved by making the inner
subroutine anonymous, using the sub {} syntax.
Another approach would be to move the read_size subroutine's declaration outside of the block.
These are purely structural solutions; I'm not even sure you need to be doing what you're trying to do here (read is built to handle the issue of when you try to read a larger chunk than what's left in the file).
HTH
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: mod_perl: variable $end will not stay shared (nested subroutines problem)
by arturo
in thread mod_perl: variable $end will not stay shared (nested subroutines problem)
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |