To-Experts: BIG problem: my variables in nested subroutines, which call each other

2000-05-09 Thread Christoph Haberberger

Hi!

I should migrate Perl-CGIs to mod_perl for performance reasons.
We use many subroutines in our CGIs, which read and write
global (my-defined) variables. Our plain subroutines are not nested,
but they are when the mod_perl wrapper is put around them at execution time.

In this special case, some values are not updated. You get this error:
Variable "$var-name" will not stay shared at script-file line line-no
(#1)

This problem is also discribed under:
http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S

This page says to convert all subroutines to "anonymous" subroutines.
This works fine, as long as anonymous subroutines call other anonymous
subs defined before. Ok, now you can order all subroutines, so that they are
always
defined before they are called.

QUESTION: But how should I transform the script, if the anonymous subs call
each other?
I get always the following error:
Undefined soubroutine main:: called at script-file line line-no.

I don't know how to solve this. Is there any solution for this? Can I make
any prototype defs for such subroutines?

BIG THANKS IN ADVANCE,
Christoph.

yLine Internet Services AG



BIG problem seems to be a LITTLE one is solved. THANKS for all comments.

2000-05-09 Thread Christoph Haberberger

See subject.