Welcome! Log In Create A New Profile

Advanced

Re: Is there any way to use a nginx variable inside a perl set?

Maxim Dounin
August 17, 2010 08:22PM
Hello!

On Tue, Aug 17, 2010 at 05:18:20PM -0400, evms wrote:

> Let's imagine that I do this
>
> http {
> set $a 2;
> perl_set $x sub { return $a++; }
> }
>
> I don't think I can do this. Is there away around this to provide that
> functionality?

Something like this should work (not tested):

perl_set $x "sub {
my $r = shift;
my $a = $r->variable{'a'};
$a++;
$r->variable('a', $a);
return $a;
}";

See here for details:

http://wiki.nginx.org/NginxEmbeddedPerlModule

Maxim Dounin

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

Is there any way to use a nginx variable inside a perl set?

evms August 17, 2010 05:18PM

Re: Is there any way to use a nginx variable inside a perl set?

Maxim Dounin August 17, 2010 08:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 138
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