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?
Posted at Nginx Forum:
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?
Posted at Nginx Forum:
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 D.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs