16

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.

tereško
  • 58,060
  • 25
  • 98
  • 150
Jagmal
  • 5,726
  • 9
  • 35
  • 35

12 Answers12

21

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.

David McLaughlin
  • 5,108
  • 4
  • 34
  • 35
  • just checking if our current framework is already using CGI.pm is there good enough reason to jump to Catalyst? the goal is to be very web 2.0 friendly. thanks. – melaos Dec 18 '08 at 09:45
  • 4
    If you're not sure of the reasons to move to a framework then personally I don't think you should be doing that. Try the framework out on a personal project and make sure you fully understand it first. – David McLaughlin Jan 06 '09 at 11:22
  • The beauty of Catalyst (at least last time I used it, which was a few years ago) is that you can plug in your favorite components in place of the default ones it ships with. Prefer a different ORM than Rose::DB::Object (though I don't know why you would...)? You can use it instead. S'nice that way. – Dan Ray Jul 19 '11 at 12:11
  • @David: Maypole is pretty much abandoned for all I know, I wouldn't recommend that one. Don't know PageKit, but Jifty may also be an alternative. – Leon Timmermans Sep 05 '08 at 11:50
  • A version of Maypole was last released in April 2008. That doesn't sounds like abandonware to me. – Dave Cross Sep 17 '08 at 13:53
  • That only contained a handful of bugfixes. The last release before that was August 2007. One bugfix release per 6 months isn't what I call very alive. – Leon Timmermans Sep 17 '08 at 22:24
  • Would you change your answer now that there's Mojolicious, which I believe was written by one of the creators of Catalyst? – vol7ron Mar 27 '12 at 21:00
  • This answer is hopelessly outdated. Both PageKit and Maypole got its last updated 5+ years ago. Today they are in reality 3 alternatives when it comes to serious perl web frameworks, and that is [Catalyst](http://www.catalystframework.org/), [Mojolicious](http://http://www.mojolicio.us/) and [Dancer](http://http://www.perldancer.org/) – Joakim Jul 23 '12 at 12:01
  • As @Joakim has noted, a lot of time has passed and this should no longer be the accepted answer. You do not want to consider PageKit for anything other than a look at how web development was done a long time ago. Joel Berger's answer is much more up to date at this point. – oalders Jun 26 '14 at 22:25
15

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)

Joel Berger
  • 20,180
  • 5
  • 49
  • 104
8

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.

Aristotle Pagaltzis
  • 112,955
  • 23
  • 98
  • 97
  • +1 for Continuity. BTW... Squatting by default "squats" on top of Continuity thus giving u a MVC layer. – draegtun Nov 18 '08 at 16:25
5

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"

AndyG
  • 39,700
  • 8
  • 109
  • 143
draegtun
  • 22,441
  • 5
  • 48
  • 71
5

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++

RET
  • 9,100
  • 1
  • 28
  • 33
4

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.

Jeff MacDonald
  • 588
  • 3
  • 2
2

Catalyst is the way to go. There is also Jifty, but (last time I looked), it had terrible documentation.

Matthew Watson
  • 14,083
  • 9
  • 62
  • 82
2

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!

Sampson
  • 265,109
  • 74
  • 539
  • 565
dpavlin
  • 1,372
  • 2
  • 9
  • 18
2

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.

rjray
  • 5,525
  • 4
  • 31
  • 37
1

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.

akashivskyy
  • 44,342
  • 16
  • 106
  • 116
setitesuk
  • 11
  • 1
1

Another options is Gantry when used in conjunction with the BigTop module it can reduce the time it takes to build simple CRUD sites.

user229044
  • 232,980
  • 40
  • 330
  • 338
Frank Wiles
  • 1,589
  • 11
  • 13
0

I have built some applications with Kelp, it's easy to learn and very helpful.

Miguel Prz
  • 13,718
  • 29
  • 42