Learn web.development of Perl

Source: Internet
Author: User

##### #Overview of Web.development related modules. #Note that, below codes can is executed just for overview intention. ######!/usr/bin/perl#cgi::formbuilder::source::P Erl#dancer, A lightweight yet powerful Web application Framework#HTML :: Formhandler, HTML forms using Moose#mime::types, Definition of MIME types#mojolicious, real-time web Framework#plack, Fl Exible superglue between Web servers and Perl Web frameworks or Code#task::catalyst, the elegant MVC Web application frame Work. #Template, Template processing System#xml::atom, Atom feed and API Implementation#xml:rss, creates and updates RSS fi  les##### #Dancer # If you don't want to write CGI scripts by hand, and the find Catalyst too big or #cumbersome for your project, Dancer is need.#### #use dancer;get '/hello/:name ' and sub {return ' Why, hello here '. param (' name ');}; dance;##### #HTML:: formhandler##### #arributes and methods#-creating a form#-processing the form#-getting data out#- Accessing and setting up Fields#-constraintS and validation#-accessing errors#-clear form state#-miscellaneous atrributes#-flagsuse Html::formhandler; #or a custom form:use myapp::form::user;my $form = html::formhandler->new (...); $form->process (params = $params), my $rendered _form = $form->render;if ($form->validated) {#perform Valida Ted form Actions}else {#perform non-validated actions #or, return a result $result->render;}      #a dynamic Formmy $form = html::formhandler->new (name = ' User_form ', field_list = = [' username ' + =} Type = ' Text ', apply = = [{check = = qr/^[0-9a-z]*\z/, message = ' contains invalid characters       '}],}, ' select_bar ' + = {type = ' select ', Options + \ @select_options, multiple = 1,  Size = 4,},],); ##### #MIME:: types#### #use mime::types;my $mt = mime::types->new (...);  # mimi::types Objectmy $type = $mt->type (' Text/plain '); # mimi::type Objectmy $type = $mt->mimetypeof (' GIf '), my $type = $mt->mimetypeof (' picture.jpg '); my $type = $mt->httpaccept (' text/html, application/json;q=0.1 '); ##### #Mojolicious, real-time web framwork.##### #hooks #atrributes#methods#autoload#bundled files# applicationpackage  Myapp;use mojo::base ' mojolicious '; # routesub Startup {My $self = shift; $self->routes->get ('/hello ')->to (' Fool#hello ');}   # controllerpackage Myapp::controller::foo;use mojo::base ' Mojolicious::controller '; # Actionsub Hello {my $self = shift; $self->render (text = ' Hello world! ');}  # #hooks #after_build_tx$app->hook (after_build_tx =>sub {My ($tx, $app) = @_; ...});  #before_dispatch $app->hook (before_dispatch = {my $c = shift; ...});  #after_static $app->hook (after_static = + Sub {my $c = shift; ...});  #before_routes $app->hook (before_routes = + Sub {my $c = shift; ...}); #around_action #before_render#after_render#after_dispatch#around_dispatch##### #Plack, Perl superglue for Web Frameworks and Web servers (PSGI toolKit) ##### #modules and Utilities#plack::handler#plack::loader#plack::util#psgi files#plackup, Plack::runner#plack:: Middleware#plack::request, Plack::response#plack::test#plack:test::suite

>>more of PErl web.development

Mars

Learn web.development of Perl

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.