The only global variable I'm using is AUTOLOAD. I'm coding in OO style and using inheritance. I'm using AUTOLOAD for more flexibility in my object structures.
package Entities::Entity; our $AUTOLOAD; use constant UNDEF_VALUE => '##UNDEF_VALUE##'; sub new() { my ($class) = @_; my $self = { }; bless $self, $class; return $self; } sub AUTOLOAD { my ($self, $val) = @_; my $type = ref($self) or croak "$self is not an object"; my $name = $AUTOLOAD; $name =~ s/.*://; # strip fully-qualified portion if (defined($val)) { if ($val eq UNDEF_VALUE) { $self->{$name} = undef; } else { return $self->{$name} = $val; } } else { my $val = $self->{$name}; $self->{$name} = undef unless (defined($val)); if (ref($val) eq "HASH") { return \%$val; } if (ref($val) eq "ARRAY") { return \@$val; } return $val; } }
package Customer::Entities::CustomerInvoice; use base qw(Entities::Entity); sub new { my ($class) = @_; my $self = $class->SUPER::new(); return $self; }

On the other hand, everytime a new request comes in, new objects are created. If the member's values were cached, nothing would work properly I guess. Also, my debug messages show that each object is different.

On the database end, the only package level global variable is a hash holding the database handles. I do not do any explicit caching. There is also no cached queries in mysql.

I was suspecting apache/modperl to do some transparent query result caching for long running queries. Could it be the case ? (for info, I'm running ActivePerl 5.10, Apache 2.2, XP SP2).

I thought I would try to look into apache's memory and see what objects are still in cache after a request but I cannot find a repository for the B-Size module. Any idea where to find this ? (probably different topic)

Thanks

In reply to Re^2: mod_perl sql result cache by jbenezech
in thread mod_perl sql result cache by jbenezech

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.