Welcome! Log In Create A New Profile

Advanced

Re: [ANNOUNCE] nginx-perl-1.1.17.1

Alexandr Gomoliako
March 20, 2012 01:14PM
> 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}) {
...
}
}

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

[ANNOUNCE] nginx-perl-1.1.17.1

Alexandr Gomoliako March 15, 2012 03:56PM

Re: [ANNOUNCE] nginx-perl-1.1.17.1

valor March 20, 2012 12:44PM

Re: [ANNOUNCE] nginx-perl-1.1.17.1

Alexandr Gomoliako March 20, 2012 01:14PM

Re: [ANNOUNCE] nginx-perl-1.1.17.1

valor March 20, 2012 02:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 123
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready