In your case, you are seeing this error because you declare the lexical variable 'my $bufsis' outside your named subroutine read_size() but $bufsis then appears inside your named subroutine. (Variables declared using my() are called lexical in Perlish.)
When a lexical variable and a named subroutine are in the same lexical scope, and the lexical variable is declared outside the subroutine but appears inside the subroutine you get a message such as yours.
Solutions? Well, you can make the lexical variable a global one. Or you can pass the lexical variable as a parameter to your subroutine. Or you can make your subroutine anonymous instead of named. There are a lot of workarounds, but I don't know which is the best. I think that Tye or Tilly yesterday proposed something along the lines of the first solution, make the lexical variable a non-lexical one.
In reply to Re: mod_perl: variable $end will not stay shared (nested subroutines problem)
by sierrathedog04
in thread mod_perl: variable $end will not stay shared (nested subroutines problem)
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |