[ANNOUNCE] nginx-perl-1.1.17.1

Alexandr Gomoliako zzz at zzz.org.ua
Tue Mar 20 17:11:59 UTC 2012


> My question is:
> There is any way to store information in memory to use between
> different requests within perl?

There is just one interpreter instance per worker. So every variable
outside of the handler's scope is persistent across multiple requests.

    my %cache;
    my $count = 0;

    sub handler {
        my ($r) = @_;
        ...
        $count++;
        ...
        my $uri = $r->uri;
        if ($cache{$uri}) {
            ...
        }
    }



More information about the nginx mailing list