#!/usr/bin/perl use Dancer; get '/hi' => sub { "Hello World!" }; dance; |
$ perl ./hi.pl >> Listening on 127.0.0.1:3000 == Entering the dance floor ... == GET /hi HTTP/1.0 200 OK |
#!/usr/bin/perl use Dancer; use Template; my @pages = qw(quickstart documentation contribute about example); get '/' => sub { template 'home'; }; get '/:page' => sub { my ($page) = params->{page}; pass and return false unless grep /$page/, @pages; template $page; }; get '/*' => sub { status 'not_found'; template 'not_found'; }; dance; |
原帖由 2gua 于 2010-1-2 13:58 发表
Ruby的框架,成熟度都不高,比如RoR,时常有内存泄漏的现象出现,相比较而言,PHP还是让人放心的,用Perl来实现CGI方式也是没问题的。对于Perl的框架技术Catalyst,有没有人接触过呢?最好有人说说看。
Caught SIGINT, trying to continue
XSAWYERX/Dancer-1.2003.tar.gz
nmake test -- NOT OK
//hint// ...
yakczh 发表于 2011-01-29 14:02
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for ...
yakczh 发表于 2011-01-29 20:32
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |