Is there a list comparing the features of different frameworks available for developing web apps in Perl? - perl

I've recently been learning perl and am wondering what frameworks are available for creating a web app. I'm mostly concerned about security, so if there are any security-specific web frameworks you'd recommend, I'd be more interested in those.
Currently accepted answer from thread below

This thread on perlmonks has some info regarding Catalyst (which is the most modern/powerful Perl Web development framework) in security context.
For overall comparison, there are several of them linked in "Comparisons" section of Web Frameworks/Perl5 Wiki
Also, please remember that the main problem security wise is the developer - you can write hole-ridden code in the most secure framework if you don't have proper security-centric outlook in your development (that was the main point given to us in our secure web development training, and I happen to agree).
Also, as per Brian's question in the comment, these are a couple of helpful general "web security in Perl" links:
CGI Programming with Perl book (Duh) - Chapter 8. Security
W3C CGI Security FAQ - especially Q14 and Q15 (exec and taint checks)
Security Issues in Perl Scripts
Perl Security and Regular Expressions

There are plenty of frameworks, some of the more popular ones are Catalyst, Web::Simple and CGI::Application. Catalyst is the more complex and powerful one, well suited to big web applications.

There's a few others that I can think of, too:
Mojolicious, a small and powerful framework, with descriptions on their website.
Dancer, a framework similar to Mojolicious that is designed to make it easy to get started with nothing other than its framework.
In fact, there's a bit of a competition going on between Mojolicious and Dancer right now to be the new framework to build the new CPAN Top 100 website:
Competition Announcement
Week 1: Install, Support, Hello World
Week 2: Templates

In addition to just the web frameworks, check out the perlsec doc in your perldoc kit. It talks about all the features Perl has for creating secure, protected code. The biggest one is taint mode, in which strings from any insecure place are marked internally, and if used without being processed (usually with a regex), throw warnings or errors. This language feature can help you catch possible problems with reading from untrustable locations.

Another resource is the Template Toolkit. This gives you a formatting / templating tool for your webpages. From their site:
The Template Toolkit is a fast, flexible and highly extensible template processing system. It is Free (in both senses: free beer and free speech), Open Source software and runs on virtually every modern operating system known to man. It is mature, reliable and well documented, and is used to generate content for countless web sites ranging from the very small to the very large.

Related

How can I do web programming with Lisp or Scheme?

I usually write web apps in PHP, Ruby or Perl. I am starting the study of Scheme and I want to try some web project with this language. But I can't find what is the best environment for this.
I am looking for the following features:
A simple way of get the request parameters (something like: get-get #key, get-post #key, get-cookie #key).
Mysql access.
HTML Form generators, processing, validators, etc.
Helpers for filter user input data (something like htmlentities, escape variables for put in queries, etc).
FLOSS.
And GNU/Linux friendly.
So, thanks in advance to all replies.
Racket has everything that you need. See the Racket web server tutorial and then the documentation. The web server has been around for a while, and it has a lot of features. Probably the only thing that is not included is a mysql interface, but that exists as a package on PLaneT (Racket package distribution tool).
UPDATE: Racket now comes with DB support, works with several DBs including mysql.
You may want to have a look at Clojure:
Clojure is a dynamic programming language that targets the Java Virtual Machine. [...] Clojure provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection.
Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system.
Interop with Java is straightforward in Clojure, so you can re-use any existing Java libraries as you need. I'm sure there are plenty that are useful for web development.
clojure-contrib has an SQL API, and there is ClojureQL as well, which should cover your DB access needs.
There is a web framework for Clojure called Compojure under development. There may be others, too.
Clojure's source is available on github under the EPL. Getting it running on Linux is easy; I just clone the git repos and run ant.
You can do web development with guile scheme. Its standard library includes the (sxml simple) module that is very useful for html generation, manipulation, and parsing. The guile-www library adds support for http, cgi, etc. The guile-dbi library provides access to MySQL and other databases. With these building blocks, you can implement everything from simple cgi scripts to web applications with their own HTTP server.
Try Weblocks, a Common Lisp web framework:
http://weblocks.viridian-project.de/
I've written a pretty extensive tutorial/ebook on the topic: http://lispwebtales.ppenev.com/
Quick summary:
It uses Common Lisp
It uses the Restas framework
It has examples for pretty much most of basic web development, including DB access, authentication, HTML generation and templating.
Since the Restas documentation is pretty much out of date, my tutorial is the closest thing to up to date docs.
Shows a few of the more advanced features, like policies, which allow you to write pluggable interfaces, for instance you can write a data store layer, and write back-ends for different storage mechanisms with relative ease, the module system which allows you to write reusable components, like auth frameworks and things like that.
It covers things like installing lisp, setting up the ASDF build system and the quicklisp package manager etc.
It's free online, and as soon as I finish it it will be free on leanpub as well. The source is on https://github.com/pvlpenev/lispwebtales under a CC license, the source code is MIT. Not all of it is published yet, and I'm in the process of revising.
This may be what you are looking for.
http://www.plt-scheme.org/
http://docs.plt-scheme.org/web-server/index.html
http://common-lisp.net/project/cl-weblocks/
If you are interested in Common Lisp to be exact and do not want to go the weblocks route I would recommend the following setup:
Use SBCL on Linux but with multiple thread support
Use Hunchentoot as a web server which will provide you with all the server processing required including sessions and cookies
Use ClSql to communicate with MySql it has ample documentation and is very stable.
For the HTMl generation you can use Dr Edi Weitz Cl-WHO (very well documented).
Note all the above are under GPL or similar license (one that works more for lisp programs)
Gambit Scheme has its own solution to web apps as well. It uses the Spork framework, based o the Black Hole module system (both by Per Eckerdal).
Andrew Whaley has an initial tutorial on how to get Gambit, Black Hole and Spork running a web app under Apache using mod_proxy. You might want to take a look at that.
On a (possibly) related note, Gambit will also compile your stuff to C and then to an executable, if you feel so inclined.
Paul Graham (and friends) made a lisp dialect specifically for writing basic web applications. It's called Arc, and you can get it at arclanguage.org.
It's probably not suited for really big complex websites and I'm not sure what state it's database support is at but Paul Graham knows how to write web applications in lisp, so Arc will make the HTTP/HTML part easy for you while you spend most of your brain cycles learning the lisp way.
Weblocks is nice tool for building web apps in Common Lisp, but a bit too heavy-weight for me.
We use the following stack:
OpenMCL (open source Lisp, very nice)
Portable Allegroserve (web server, HTML generator)
Our own Rails-like tools for doing Ajaxy stuff (update: this has now been open sourced as WuWei)
A variety of CL libraries like cl-json, cl-smtp, md5
I use my own, customized version of Scheme, derived from MzScheme. It has a new, simple web-application framework, a built-in web-server (not the one that comes with MzScheme) and ODBC libraries. (http://spark-scheme.wikispot.org/Web_applications). The documentation may not be exhaustive, as this is more of a personal tool. But there are lots of sample code in the code repository.
Clojure is a Lisp dialect which may interest you. At this point there's a pretty decent web development stack. I can recommend a few things:
The leiningen dependency manager which makes is really easy to install and manage libraries that you're using. Pretty nice set of plugins for it too. There's even a plugin for Clojurescript, which is a language based on Clojure that compiles to Javascript.
The ring HTTP server abstraction. Its used in most actual web frameworks. Its a pretty good idea to learn that first before jumping into an actual framework.
hiccup is a HTML dsl/templating language written in Clojure. Its very expressive! Reminds me a bit of Jade, in a sense.
composure would have to be the most popular web framework for Clojure. Its essentially a routing library like express.js.
Let's see what can be done with Common Lisp.
The state of the Common Lisp ecosystem (2015) and the Awesome Common Lisp list show us a couple of modern frameworks (Caveman, Lucerne, all built on the new Clack web application server, an interface for Hunchentoot and other servers). Let's discuss with our own findings.
update 2019: there's a new tutorial on the Common Lisp Cookbook: https://lispcookbook.github.io/cl-cookbook/web.html It covers routing, template engines, building self-contained binaries, deployment, etc.
update: a bit later, I found out Snooze, by the creator of Sly or Emacs' Yasnippet, and had a much better impression than say Caveman. Declaring endpoints is just like declaring functions, so some things that were tedious in Caveman are obvious in Snooze, like accessing the url parameters. I don't have much experience with it but I recommend checking it out.
update june 2018: also don't miss the ongoing rewrite of Weblocks, it's going to be huge ! :D http://40ants.com/weblocks/quickstart.html Weblocks allows to build dynamic webapps, without a line of Javascript, without separating the back and front. It is components-based, like React but server-side. It's very alpha as of writing (june 2018), but in progress, and it's working, I have a couple simple web apps working.
A simple way of get the request parameters (something like: get-get #key, get-post #key, get-cookie #key).
I found easier the Lucerne way, it iss as simple as a with-params macro (real world example):
#route app (:post "/tweet")
(defview tweet ()
(if (lucerne-auth:logged-in-p)
(let ((user (current-user)))
(with-params (tweet)
(utweet.models:tweet user tweet))
(redirect "/"))
(render-template (+index+)
:error "You are not logged in.")))
Caveman's way has been less clear to me.
Mysql access
Caveman advertises database integration (with Fukamachi's Datafly and sxql).
You can just use clsql or the Mito ORM: https://lispcookbook.github.io/cl-cookbook/databases.html
HTML Form generators, processing, validators, etc.
I don't know if there are form generators out there. edit: there are: cl-forms and formlets, or again 1forms, working with Caveman2.
Caveman does not have one (issue raised in 2011).
Helpers for filter user input data (something like htmlentities, escape variables for put in queries, etc).
Ratify is an input validation library, not integrated into a framework though.
FLOSS and GNU/Linux friendly: ✓
Other web stuff
Speaking about web, there are other nice libraries in CL land:
web servers: Woo is a fast HTTP server, faster than Nodejs (beware of charts…), wookie is an async http server,
Dexador is an HTTP client
Plump, lquery and CLSS make it easy to parse html and query the DOM.
cl-bootstrap offers twitter-bootstrap shortcuts for the cl-who templating engine (which kind of replaces Jade/Pug, even though we have usual templates too).
Ajax in Lisp
(remember, with Weblocks, see above, we might not need those)
With ParenScript, we can write JavaScript in Common Lisp, without living our usual workflow, and we can thus use the fetch web API to write Ajax calls.
Clojure would be perfect for this. With some very short, clean code, you can implement some very complex applications, such as blogs or forums.
You might want to consider the awful web framework for Chicken Scheme.
Natively supports PostgreSQL and SQLite
Built-in easy support for sessions
Shortcuts for some webdev idioms, like the (ajax) procedure
Your app can be easily compiled to a static executable (via csc -static) for easier deployment
The collection of all chicken libraries (eggs) isn't as versatile as in some other programming languages, but isn't awful either

What languages can be used to make dynamic websites?

So, there are several languages which will allow you to create a website, as long as you configure the server(s) well enough.
To my knowledge, there is:
PHP
ASP.NET
Ruby(on rails, what is
that all about?)
And thusly, my knowledge is limited. Ruby and ASP, I've only heard of, never worked with. If there are other languages, I suppose they have some way to make files containing the needed html. It would then suffice to add a line to the Apache config to associate the file-extension.
And if other languages: are there any notable characteristics about the one(s) you mention?
ANY language can be use to make a dynamic website - you could do it in COBOL or FORTRAN if you were twisted enough. Back in the olden days (about 10 years ago) most dynamic websites were done with CGI scripts - all you needed was a program that could read data from standard input and write data (usually HTML) to standard output.
Most modern languages have libraries and frameworks to make it easier. As well as the languages you have already mentioned, Java, C# and Python are probably the most common in use today.
Typically a web framework will have:
a way of mapping URLs to a class or function to handle the request
a mechanism for extracting data from a request and converting it into an easy to use form
a template system to easily create HTML by filling in the blanks
an easy way to access a database, such as an ORM
mechanisms to handle caching, redirections, errors etc
You can find a comparison of popular web frameworks on wikipedia.
How can you forget Java ? :)
Python
It runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java and .NET virtual machines.
Python is a perfect scripting language for web applications, e.g. via mod_python for the Apache web server. With Web Server Gateway Interface a standard API has been developed to facilitate these applications. Web application frameworks or application servers like Django, Pylons, TurboGears, web2py and Zope support developers in the design and maintenance of complex applications. Around libraries like NumPy, Scipy and Matplotlib, Python is a standard in scientific computing.
Among the users of Python are YouTube and the original BitTorrent client. Large organizations that make use of Python include Google, Yahoo!, CERN, NASA,and ITA.
This could be for your interest.
Virtually thru CGI all programming languages that produce output may use for web page generation.
Basically, you can use any language (if you are hosting your own server)
Very closely related and very interesting is this article where LISP has been used to build a very succesfull website.
Python has a 3rd party module CherryPy which can be used with or without a http server.
Amongst others: Erlang (YAWS, Mochiweb), Python
JSP has the advantage that it automatically wraps your code in a servlet, compiles that to bytecodes, then uses the just-in-time Java compiler to recompile critical sections into native object code. Not aware of any alternative which allows optimizes your work automatically in this way.
Also allows you to develop and deploy on any combination of Windows, Mac OS X, or Linux.
If you'd like to choose one for the beginning, you should check out PHP first. It gives you the basic clues about how dynamic sites work in general.
After you've become familiar with the basics, I recommend ASP.NET.
Fist off, you should know that ASP.NET is a technology and not a language. (It actually supports any language that can be used on the .NET platform.) Also it is not to be confused with classic ASP. (The old ASP was much more like PHP.)
ASP.NET is very easy to begin with, and after you have some clues about its concepts, you can always dig deeper and customize everything in it. The http://asp.net site is a very good starting point, if you are to learn it. I think it is really worth the effort, because even if you choose not to stick to it, it will give you some interesting ideas and concepts.
I tell you its most important advantages:
The code is compiled (and NOT interpreted like PHP), and it has a very good performance. (In a performace comparsion, it is 10-15 times faster. http://www.misfitgeek.com/pages/Perf_Stat_0809.htm)
It can be run on Windows without effort, and on Linux / Mac / etc using the Mono project.
It implements the Separation of Concerns principle very well.
It has most of the general functionality you'll need built-in. (Such as membership, roles, database management, and so on.)

Lisp Web Frameworks? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What are the popular (ok, popular is relative) web frameworks for the various flavours of LISP?
PLT Scheme features a built-in, continuation-based web server.
Update: PLT Scheme is now called Racket.
Hunchentoot is also quite widespread
What is Weblocks?
Weblocks is a continuations-based web framework written in Common Lisp.
http://common-lisp.net/project/cl-weblocks/
Most (perhaps all) of the well-known Common Lisp web frameworks have already been mentioned, so I'll just add some comments.
Hunchentoot is not a "web framework" in the sense that most people mean. It's an HTTP server (an extremely good one).
Drew Crampsie's "Lisp on Lines" looks extremely promising, but I'm not sure how far along it is. I've been waiting to hear an announcement.
Marco Baringer's UnCommon Web runs on many of the prominent CL implementions: Allegro CL, CMUCL, Clozure CL (formerly known as OpenMCL), GNU clisp, and SBCL. The only major one missing is LispWorks; I don't know if that means it hasn't been tested to work, or is known not to work, or what; but if it runs on all those other dialects, it's probably easy to make it run on any other.
For Clojure you can try Compojure.
Common Lisp
A lot of the usual suspects (Hunchentoot, UCW, LoL) have already been mentioned.
Franz makes available for Allegro Common Lisp (and ported to other Lisps):
at a lower level (handling HTTP requests yourself), AllegroServe.
at a higher level (more of a "framework"), WebActions.
Both are open source. I tend to use AllegroServe, factoring out utilities as I need them, but some people really like WebActions.
I used Araneida for quite some time, and I prefer its style to AllegroServe, but it hasn't been maintained since 2006.
I've searched quite extensively for a good web framework for Lisp, and I found them all to be somewhat inaccessible. The Architecture of UCW didn't seem very natural to me (I can't remember why; it's been a while since I looked into it), and KPAX isn't maintained anymore (I think).
Symbolic web looks very interesting, and I think Weblocks is the most interesting, but Weblocks isn't very well documented and can be pretty intimidating to the newcomer. SymbolicWeb was immature last time I looked, but it may have grow up some since then. The features page looks pretty good today.
There are different approaches you could take. If you want a purely lisp approach, then you could:
If you can read code proficiently and understand continuations, you might try Weblocks with a Hunchentoot backend (Weblocks has a dependency on Hunchentoot that hasn't been abstracted yet). There is supposed to be a real user manual out in a month or two, but as with any OSS project, such commitments are sketchy.
Similarly, you might try SymbolicWeb. [update: nevermind, the project is no more]
roll your own. Seriously - there's cl-who to help with HTML generation, there are javascript and json libraries available, usockets, elephant, cl-sql, hunchentoot, aserve, and lots of utility libraries that you could bake together.
If you are ok with a hybrid approach, this is something I'm experimenting with at the moment: I've written a Lisp JSON-RPC backend for Qooxdoo, so I can serve up pure javascript frontends through a superfast http server like Cherokee and let Cherokee farm out connections to as many backend json-rpc servers running in Lisp as I want. Very, very scalable. I'm far from figuring out the kinks and challenges, but it was pretty straight-forward to get working. the json library makes it stupid simple to get the backend working - Qooxdoo itself is actually harder, I think (but I'm not a JS developer, really).
I'm also going to be checking out WebActions from allegro, because there's a certain allure to the availability of paid support - not to mention that Allegro may be the best CL implementation available (His Kennyness uses it :-)).
UnCommonWeb (UCW) is often mentioned http://www.common-lisp.net/project/ucw/ -- it's not REST as is in en-vogue at the moment, more like Smalltalk's SeaSide (but then again, SeaSide is quite en-vogue).
LeftParen
Lisp-on-lines is a web application framework built on top of CLSQL and UCW and provides an application development model similar in many ways to Ruby on Rails. Right now it can be found at http://versions.tech.coop/lisp-on-lines/.
http://www.cliki.net/lisp-on-lines
http://kevin.casa.cavewallarts.com/LISP/LOL/lol.html
For Clojure you can try Webjure.
I just discovered a web framework called Clack for common lisp and found it quite easy to get started.
See http://clacklisp.org/
Quote from it's web site
"Clack is a web application environment for Common Lisp inspired by Python's WSGI and Ruby's Rack."
and caveman is a micro web framework based on Clack.
Another cool (yet far from "popular") thing to look at is SymbolicWeb -- http://groups.google.com/group/symbolicweb
Re: SymbolicWeb (and its exaggerated demise)
SymbolicWeb project page at Gitorious and SymbolicWeb article at Wikipedia. The Google Groups page is definitely dead (and unarchived?,) but the Gitorious tree shows checkins as recently as 29 April 2010. The project page also refers to "some running examples" being "occasionally available" at nostdal.org (which is unreachable as I write this, reinforcing the "occasionally" qualifier :-) .)
(Note: I'm not a SymbolicWeb user. I just tracked down the SymbolicWeb links while reading this thread.)
Restas is another web framework that has seen recent updates:
http://restas.lisper.ru/en/
Its overview
RESTAS is a Common Lisp web application framework. Its key features are:
RESTAS was developed to simplify development of web applications following the REST architectural style.
RESTAS is based on the Hunchentoot HTTP server. Web application development with RESTAS is in many ways simpler than with Hunchentoot, but some knowledge of Hunchentoot is required, at least about working with hunchentoot:*request* and hunchentoot:*reply*.
Request dispatch is based on a route system. The route system is the key concept of RESTAS and provides unique features not found in other web frameworks.
The other key RESTAS concept is its module system, which provides a simple and flexible mechanism for modularized code reuse.
Interactive development support. Any RESTAS code (such as the definition of a route, a module or a submodule) can be recompiled at any time when you work in SLIME and any changes you made can be immediately seen in the browser. No web server restart or other complicated actions are needed.
SLIME integration. The inner structure of a web application can be investigated with the standard "SLIME Inspector." For example, there is a "site map" and a simple code navigation with this map.
Easy to use, pure Lisp web application daemonization facility based on RESTAS and SBCL in Linux without the use of Screen or detachtty.
RESTAS is not an MVC framework, although it is not incompatible with the concept. From the MVC point of view, RESTAS provides the controller level. Nevertheless, RESTAS provides an effective and flexible way for separation of logic and representation, because it does not put any constraints on the structure of applications. Separation of model and controller can be effectively performed with Common Lisp facilities, and, hence, doesn't need any special support from the framework.
RESTAS does not come with a templating library. cl-closure-template and HTML-TEMPLATE are two good templating libraries that can be used with RESTAS.
This question is a bit old but I thought I'd share my recent discovery: the Hop language which is based on Scheme and is quite complete.
HOP is a multi-tier programming language for the Web 2.0 and the so-called diffuse Web. It is designed for programming interactive web applications in many fields such as multimedia (web galleries, music players, ...), ubiquitous and house automation (SmartPhones, personal appliance), mashups, office (web agendas, mail clients, ...), etc.
HOP features:
an extensive set of widgets for programming fancy and portable Web GUIs,
full compatibility with traditional Web technologies (JavaScript, HTML, CSS),
HTML5 support, a versatile Web server supporting HTTP/1.0 and HTTP/1.1,
a native multimedia support for enabling ubiquitous Web multimedia applications,
fast WebDAV level 1 support,
an optimizing native code compiler for server code,
an on-the-fly JavaScript compiler for client code,
an extensive set of libraries for the mail, calendars, databases, Telephony, ...

Do you need a framework to write Ruby or Python code for the web?

Every time I see Ruby or Python discussed in the context of web development, it's always with a framework (Rails for Ruby, Django for Python). Are these frameworks necessary? If not, is there a reason why these languages are often used within a framework, while Perl and PHP are not?
I can only speak towards Ruby - but, no, you don't need a framework to run Ruby based pages on the web. You do need a ruby enabled server, such as Apache running eruby/erb. But, once you do, you can create .rhtml files just like RoR, where it processes the inline ruby code.
The short answer is no, they are not necessary. In ruby you have .erb templates that can be used in a similar way as you use PHP pages. You can write a site in ruby or Python using several technologies (Rails-like frameworks, Templates or even talking directly with the HTTP library and building the page CGI-style).
Web frameworks like Python's Django or Ruby's Rails (there are many) just raise the level of abstraction from the PHP's or ASP's, and automate several process (like login, database interaction, REST API's) which is always a good thing.
"Need" is a strong word. You can certainly write Python without one, but I wouldn't want to.
Python wasn't designed (like PHP was, for example) as a direct web scripting language, so common web-ish things like connecting to databases isn't native, and frameworks are handy.
EDIT: mod_python exists for Apache, so if you're merely looking to write some scripts, then Python doesn't need a framework. If you want to build an entire site, I'd recommend using one.
From a Pythonic point of view, you'd absolutely want to use one of the frameworks. Yes, it might be possible to write a web app without them, but it's not going to be pretty. Here's a few things you'll (probably) end up writing from scratch:
Templating: unless you're writing a really really quick hack, you don't want to be generating all of your HTML within your Python code -- this is a really poor design that becomes a maintainability nightmare.
URL Processing: splitting a URL and identifying which code to run isn't a trivial task. Django (for example) provides a fantastic mechanism to map from a set of regular expressions to a set of view functions.
Authentication: rolling your own login/logout/session management code is a pain, especially when there's already pre-written (and tested) code available
Error handling: frameworks already have a good mechanism in place to a) help you debug your app, and b) help redirect to proper 404 and 500 pages.
To add to this, all of the framework libraries are all heavily tested (and fire tested). Additionally, there are communities of people who are developing using the same code base, so if you have any questions, you can probably find help.
In summary, you don't have to, but unless your project is "a new web framework", you're probably better off using one of the existing ones instead.
Framework? Heck, you don't even need a web server if you're using Python, you can make one in around three lines of code.
As to the why:
The most plausible thing I can think of is that Perl and PHP were developed before the notion of using frameworks for web apps became popular. Hence, the "old" way of doing things has stuck around in those cultures. Ruby and Python became popular after frameworks became popular, hence they developed together. If your language has a good framework (or more than one) that's well supported by the community, there's not much reason to try to write a Web App without one.
A framework isn't necessary per se, but it can certainly speed development and help you write "better" code. In PHP, there are definitely frameworks that get used like CakePHP, and in Perl there are many as well like Mason and Catalyst.
The frameworks aren't necessary. However, a lot of developers think frameworks ease development by automating a lot of things. For example, Django will create a production-ready backend for you based on your database structure. It also has lets you incorporate various plugins if you choose. I don't know too much about Rails or Perl frameworks, but PHP frameworks such as Zend, Symfony, Code Igniter, CakePHP, etc are used widely.
Where I work at we rolled our own PHP framework.
Are these frameworks necessary?
No. They, like any 'framework', are simply for speeding up development time and making the programmer's job easier.
If not, is there a reason why these languages are often used within a framework, while Perl and PHP are not?
PHP and Perl were popular languages for building web sites well before the idea of using frameworks was. Frameworks like Rails are what gave Ruby it's following. I'm not sure that Python or Ruby were that common as web languages before they were backed by frameworks.
These days, even PHP/Perl web developement should be backed by a framework (of which there are now many).
By no means are those development frameworks required. But as with most development environments, your productivity will increase exponentially if you have a supported framework to reference and build your applications on. It also decreases the training needed to bring others up to speed on your applications if they already have a core understanding of the framework that you use.
For python, the answer is No you don't have to. You can write python directly behind your web server very easily, take a look at mod_python for how to do it.
A lot of people like frameworks because they supply a lot of the boilerplate code in a reliable form so you don't have to write it yourself. But, like any code project, you should choose the tools and frameworks on their merit for your problem.
You can certainly write CGI scripts in either language and do things "raw".
The frameworks (ideally) save the trouble of writing a pile of code for things that other people have already handled (session handling, etc.).
The decision probably comes down to what you need to do. If the framework has the features you need, why not use it. If the framework is going to require extensive modifications, it might be easier to roll your own stuff. Or check out a different framework.
The python library has numerous modules for doing cgi, parsing html, cookies, WSGI, etc:
http://docs.python.org/library/index.html
PHP has a lot of frameworks. Probably more then most. In Ruby most use Rails so thats what you hear, and Django for Python is mentioned more then not.
But with PHP you have many to choose from.
List of web application frameworks
Any language that can "print" can be used to generate web pages, but frameworks handle a lot of the HTML generation for you. They let you concentrate more on the content and less on the details of coding the raw HTML.

Suggest some good MVC framework in perl [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Can you suggest some good MVC framework for perl -- one I am aware of is catalyst
The need is to be able to expose services on the perl infrastructure which can be called by Java/.Net applications seamlessly.
I'll tell you right now that Catalyst has by far the best reputation amongst Perl developers in terms of a rapid application development MVC framework.
In terms of "pure" MVC I'm not sure there are even that many "mature" or at least production-ready alternatives.
If Catalyst doesn't seem right to you, then you could build upon the lightweight framework CGI::Application to suit your needs or take a look at some of the lesser known MVC frameworks like PageKit and Maypole.
Since this old thread popped up, I will mention two exciting new additions to the Perl MVC world:
Dancer (CPAN) which is heavily influenced by Ruby's Sinatra, known for being very lightweight
Mojolicious (CPAN) which is written by the original developer of Catalyst to use what he learned there, it has no non-core dependencies, with very modern builtins (HTML5/CSS3/Websockets, JSON/XML parsers, its own UserAgent/templating engine)
(N.B. I have used Mojolicious more than Dancer, and as such if I missed some features of Dancer that I listed for Mojolicious then I apologize in advance)
Another alternative besides the ones already mentioned is Continuity; however, it is (as the name is meant to imply) continuation-based rather than MVC in the typical sense. Still, it’s worth mentioning because it is one of the better Perl web frameworks.
That said, I like Catalyst much better than any of the alternatives. And it’s still getting better all the time! The downside of that is that current preferred coding approaches continue to evolve at a fairly hurried clip – but for the last couple of versions, there has been strong emphasis on API compatibility, so the burden is now mostly mental rather than administrative. The upcoming port of the internals to Moose in particular is poised to provide some excellent benefits.
But the biggest argument in favour of Catalyst, IMO, is the Chained dispatch type. I have seen nothing like it in all of web-framework-dom, and it is a most excellent tool to keep your code as DRY as possible. This couples well with another great thing that Catalyst provides, namely uri_for – a method which takes a controller and a bunch of arguments and then constructs a URI that would dispatch to that place, which it returns. Together, these facilities mean that you can structure your URI space any way you deem right, yet at the same time can structure your controllers to avoid duplication of logic, and keep templates independent of the URI structure.
It’s just brilliant.
Seconding comments made by others: Catalyst (which more or less forked from Maypole) is by far and away the most complete and robust of them. There is a book by Jonathan Rockway that will certainly help you come to grips with it.
In addition to the 'Chained' dispatch type, the :Regex (and :LocalRegex) dispatch methods provide enormous flexibility. The latest app we've built here supports a lot of disparate-looking URLs through just a handful of subs using :LocalRegex.
I also particularly like the fact that you are not limited to a particular templating language or database. The mailing list (and the book) both have a preference for Template::Toolkit (as do I), and DBIx::Class (we continue to use Class::DBI), but you can use pretty much anything you like. Catalyst is marvelously agnostic that way.
Don't be put off by the fact Catalyst seems to require half of CPAN as dependencies. Once you get it up and running, it is a well-oiled machine. It has reached a level of maturity now that once you come to grips with it, you find it 'fades into the background'. You spend your time solving business needs, not fighting with the tools you use.
It does what it says on the tin. Catalyst++
Been playing with Squatting the last few days and I have to say it looks very promising and been fun to use.
Its a micro webframework (or web microframework ;-) and is heavily influenced by Camping which is written in Ruby.
NB. Squatting (& Camping) don't have model components baked into the framework. Here's the authors comments on models... "Models? The whole world is your model. ;-) I've always been ambivalent about defining policy here. Use whatever works for you"
There is also CGI::Application, which is more like the guts of a framework. It helps a person to write basic CGI's and glue bits on to it to make it as custom as they like. So you can have it use hardly any modules, or just about everyone under the sun.
Catalyst is the way to go. There is also Jifty, but (last time I looked), it had terrible documentation.
If you are already aware of Catalyst, then I recommend focusing on it. It is mature, well-documented, and has a very large user-base, community, and collection of plug-ins.
For your problem I would take a look into Jifty::Plugin::REST which allows access to models and actions using various formats.
Let me just say that Jifty doesn't have terrible documentation. However, most of included documentation is API documentation, but there is very low-noise mailing list which has useful tips and links to applications.
Wiki at http://jifty.org/ is another resource which has useful bits.
If your goal is to make video store (my favorite benchmark for 4GLs and CRUD frameworks) in afternoon, it's really worth a look!
Another options is Gantry when used in conjunction with the BigTop module it can reduce the time it takes to build simple CRUD sites.
There is also Clearpress which I can recommend as a useful database backed application. It needs fewer dependencies than Catalyst. We have written a few large applications with it, and I run a badminton ladder website using it.
I have built some applications with Kelp, it's easy to learn and very helpful.