in reply to plackup problem
You're just declaring a subroutine, there's no $app variable, which is what plackup is looking for.
Look at your example again:
my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], ['Hello World'], ]; };
Instead of declaring a subroutine, they are creating an anonymous sub and assigning it to the variable $app.
To make your code work, try the following:
my $app = \&app; sub app { my $env = shift; return [ '200', [ 'Content-Type' => 'text/plain' ], [ "Hello World" ] ]; }
This version assigns a reference to the subroutine app to the variable $app, which is the code reference plackup is looking for.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: plackup problem
by Your Mother (Archbishop) on Nov 10, 2013 at 00:47 UTC |