=head1 Developing Catalyst Applications with Padre
And what an exciting year for Perl this was! From Catalyst going Moose
to all the web buzz Perl got with the L and
L L
L, the worldwide Perl community has
never been as integrated, and programming was never this easy and fun.
One of the projects that really took off this year was L. And in today's Advent Calendar we're
gonna know a little more about it and how it can be used to write web
applications in our favorite framework :-)
=head2 What is Padre?
Padre is an Integrated Development Environment (IDE) written in Perl and
specially crafted to aid Perl development, from simple beginner scripts
to complex applications.
=begin pod:xhtml
=end pod:xhtml
While Padre is still a rather young application itself, it is growing
amazingly fast. We have already seen over 50 CPAN releases and more than
9500 commits from 49 different contributors all around the world and,
much like the Catalyst project, that list just keeps getting bigger and
bigger.
Padre was created by L to help Perl
beginners and people who are more comfortable working outside of the
command line, in a full-fledged IDE available in all major operating
systems - it even has L for Windows, MacOS X,
and some Linux distros. Padre supports class outlining and quick module
creation, has integrated Perl documentation, CPAN integration, and also
gives you code refactoring options like lexically renaming variables and
extracting subroutines. Even if you're a long-time user of vim or Emacs,
it's definitely worth a try! In fact, one of Padre's great features is
that, being written in Perl 5 itself, you can easily extend and fix your
IDE whenever you find something you miss or don't like about it. Another
killer feature for developers is Padre's ability to add even more
functionality via an extensible plugin system.
And that's precisely what we did :-)
=head2 Enter Padre::Plugin::Catalyst
L
integrates Catalyst development and Padre, (hopefully) improving the
programmer's experience.
=begin pod:xhtml
=end pod:xhtml
The Catalyst plugin has already been translated to Arabic, Brazilian
Portuguese, Chinese (Traditional), Dutch, French, German, Japanese,
Polish, Russian, and Spanish (thanks everyone!), so there is no excuse
not to try it.
=head3 Installation
cpan> install Padre::Plugin::Catalyst
If you already have L and
L
installed, this should go really smoothly. Otherwise, you might want to
check your system's L, as it can occasionally be
complicated to install the development files for wxWidgets.
Once it's installed, fire up Padre and go to the "Plugins->Plugin Manager"
menu option. You should see a window with all installed plugins listed,
including ours, with a miniaturized version of the Catalyst logo.
=begin pod:xhtml
=end pod:xhtml
To enable the Catalyst Plugin, just double click on it, or select it and
click on the "Enable" button of the Plugin Manager window.
=head2 What can we do already?
The first thing you'll notice after enabling the Catalyst Plugin is a big
"Catalyst Dev Server" panel in the bottom of your main Padre window -
probably next to the "Output" one.
This panel lets you toggle your application's development web server and
monitor its output. You can even set it to automatically restart the
server when files get modified by checking the "auto-restart" box (the
equivalent of the C<-r> option in the MyApp_server.pl script).
You'll also notice a new "Catalyst" menu entry under "Plugins". This
menu lets you create and manipulate your Catalyst apps, and also
provides quick access to the framework's extensive online documentation.
=begin pod:xhtml
=end pod:xhtml
The following options are available:
=head3 'New Catalyst Application'
As the name states, this option lets you create a new Catalyst
application in a directory of your choosing. Keep an eye in Padre's
C