Created
October 20, 2012 23:23
-
-
Save mackee/3925182 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
use 5.014; | |
{ | |
package MyApp::Dispatcher; | |
sub name { return 'Hogehoge' } | |
} | |
package MyApp; | |
use Plack::Util; | |
my $dispatcher_name = __PACKAGE__.'::Dispatcher'; | |
Plack::Util::load_class($dispatcher_name); | |
my $app = sub { | |
my $body = "Hello ".$dispatcher_name->name; | |
return [ | |
200, | |
["Content-Type" => "text/plain", "Content-Length" => length($body)], | |
[$body] | |
]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment