- use 5.01;
- use Mojolicious::Lite;
- get '/update' => sub {
- my $self = shift;
- my $resp=`svn up` ;
- say $resp;
- $self->res->headers->header('Content-Type' => 'text/html;charset=utf8');
- $self->render('baz', resp=>$resp);
- };
- app->start;
- # morbo myapp.pl
- __DATA__
- @@ baz.html.ep
- <html><head><meta http-equiv="Content-type" content="text/html; charset=utf8" /></head>
- <body>
- <%= $resp %>
- #该片段来自于http://www.codesnippet.cn/detail/220920136035.html
来源: http://www.codesnippet.cn/detail/220920136035.html