I am new to perl plack/psgi. I want to access a subroutine within the perl plack/psgi loop, but it looks like if the subroutine is not being executed. Every parent variable like $number should being passed automatically like when writing a regular perl script. Do I miss something here, is that possible?
..
my $app = sub {
my $number = 10;
&count_number;
sub count_number {
$number +=10;
}
return ['200',[ 'Content-Type' => 'application/json' ],
[ "{\"number\":$number} ]];
}
..
10 is being returned instead of 20 :(