Browse files

skeleton example scripts

  • Loading branch information...
1 parent b0baf5a commit 44881ec93738addcae5ea36c6ee6be96ee4d66ff @leejo committed May 25, 2014
Showing with 37 additions and 0 deletions.
  1. 0 examples/catalyst.pl
  2. +6 −0 examples/cgi.pl
  3. 0 examples/dancer2.pl
  4. +13 −0 examples/mojolicious_lite.pl
  5. +18 −0 examples/psgi.pl
View
0 examples/catalyst.pl
No changes.
View
6 examples/cgi.pl
@@ -0,0 +1,6 @@
+#!perl
+
+use strict;
+use warnings;
+
+use CGI qw( :standard form -utf8 );
View
0 examples/dancer2.pl
No changes.
View
13 examples/mojolicious_lite.pl
@@ -0,0 +1,13 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Mojolicious::Lite;
+
+get '/' => sub {
+ my $self = shift;
+ $self->render( text => "Hello World" );
+};
+
+app->start;
View
18 examples/psgi.pl
@@ -0,0 +1,18 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Plack::Request;
+
+my $app = sub {
+ my $env = shift;
+ my $req = Plack::Request->new($env);
+ my $params = $req->parameters;
+ return [ 200,
+ [ "Content-Type" => "text/plain" ],
+ [ map { sprintf( "%s = %s\n",$_ => $params->get($_) ) } $params->keys ]
+ ];
+};
+
+Plack::Handler::CGI->new->run($app);

0 comments on commit 44881ec

Please sign in to comment.