From: Matt S Trout Date: Mon, 30 Nov 2009 22:54:00 +0000 (+0000) Subject: add hello-world.cgi example as file X-Git-Tag: v0.003~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Simple.git;a=commitdiff_plain;h=c2f31789abcb7708edaa97daf69fd61b1d52ca92 add hello-world.cgi example as file --- diff --git a/examples/hello-world/hello-world.cgi b/examples/hello-world/hello-world.cgi new file mode 100644 index 0000000..b24dc02 --- /dev/null +++ b/examples/hello-world/hello-world.cgi @@ -0,0 +1,18 @@ +#!/usr/bin/perl + +use Web::Simple 'HelloWorld'; + +{ + package HelloWorld; + + dispatch { + sub (GET) { + [ 200, [ 'Content-type', 'text/plain' ], [ 'Hello world!' ] ] + }, + sub () { + [ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ] + } + }; +} + +HelloWorld->run_if_script;