in reply to Basic question

From the code fragment you posted, it's not possible that $Report is sometimes empty.

Could you create a small, clear, stand alone piece of code that exhibits the unwanted behaviour? Now there are too many unknowns, and I'm not going to guess what might be wrong.

Abigail

Replies are listed 'Best First'.
Re: Re: Basic question
by pcouderc (Monk) on Aug 20, 2003 at 10:06 UTC
    Thank you, Abigail.
    Are you sure of you? That is, are you sure that under mod-perl it is not possible that $Report be empty? My idea is that the scope of the variables could be different between the "main" and note()? And this, not in standard perl but in mod-perl.
    Pierre
      Of course it's possible that the scope of main and note is different. That's why I asked you to write a stand-alone piece of code, and not a piece of code where we have to fill in the blanks.

      If you leave out the "...." in your code, it's impossible that $Report is empty, except for some bug in the implementation.

      Abigail

        If you leave out the "...." in your code, it's impossible that $Report is empty

        Sorry, wrong. The part that is "left out" is mod_perl, which was clearly mentioned in the root node, and what it adds isn't where the "..."s in the shown code are.

        What it produces is close to:

        sub script { my $Report=""; sub note { my ($titre,$texte) = @_; my $Texte= '<H5>'.$titre.'</H5>­<P>'.$texte.'</P>'; $Report .=$Texte; } note($title,$text); print STDERR "*update.pl: end \n[\n$Report\n]\n"; }
        and each time the page is displayed:
        script()
        And that results in $Report being empty every time it is run except for the first. Certainly not "impossible".

                        - tye