Hi,
I have a sub on my embperl page. It is executed like this:
my $line = lineStatus();
The return value of the sub depends on the value of a system
call. I have the suspicion that the sub is only executed once per
Apache child, since I sometimes get different values in $line
after reloading the page, values that obviously got cached from a
previous request (And no, it's not the Netscape cache...). A
workaround for this of course is to include the full code of the
sub every time I would call it, but it would be nicer to know why
that caching happens or how to circumvent it cleanly... I
encountered that behaviour at least in three different scripts
until now, so I either gravely misunderstood something and wrote
completely wrong code or Embperl really behaves like I described.
Does Embperl cache the return value of a sub, and why does it do
so if it does?
modperl 1.21 static
Embperl 1.3b2
Andre
I have a sub on my embperl page. It is executed like this:
my $line = lineStatus();
The return value of the sub depends on the value of a system
call. I have the suspicion that the sub is only executed once per
Apache child, since I sometimes get different values in $line
after reloading the page, values that obviously got cached from a
previous request (And no, it's not the Netscape cache...). A
workaround for this of course is to include the full code of the
sub every time I would call it, but it would be nicer to know why
that caching happens or how to circumvent it cleanly... I
encountered that behaviour at least in three different scripts
until now, so I either gravely misunderstood something and wrote
completely wrong code or Embperl really behaves like I described.
Does Embperl cache the return value of a sub, and why does it do
so if it does?
modperl 1.21 static
Embperl 1.3b2
Andre