mateus xavierhttp://cpanratings.perl.org/dist/mateus#8466
Rating: 5 stars
I was having trouble parsing a feed with XML::RSS and then I tried this puppy. Boy am I glad. It works like a champ. The fact it can handle multiple feed types without having to specify the type, and the ability to take a URL in the constructor are features that I sure appreciate.mateus xaviermateus xavierhttp://cpanratings.perl.org/dist/mateus#7032
Rating: 5 stars
This distribution is rockin. The documentation, power, flexibility and support are quite good. As a ran into the typical learning curve challenges I was able to hump them via the aforementioned resources. It's the first time I actually felt like a form framework was making me so productive early on in the process.
I am writing an authentication system for a catalyst application that includes:
* register
* login/logout
* change password
* reset password
For my prjoect, these actions require basic forms associated with a database backend. Thus, I am using the HTML::FormHandler::Model::DBIC as the model which helps minimize the database lines of code I have to write in the controller.
FormHandler embraces Moose which makes it enjoyable to define a Form class for each one of the actions I need above. For example, here is a registration form that use the DBIC model and a table view rendering.
---->
package Bracket::Form::Register;
use HTML::FormHandler::Moose;
extends 'HTML::FormHandler::Model::DBIC';
with 'HTML::FormHandler::Render::Table';
has '+item_class' => ( default => 'Player' );
has_field 'first_name' => ( type => 'Text' );
has_field 'last_name' => ( type => 'Text' );
has_field 'email' => (
type => 'Email',
unique => 1,
);
has_field 'password' => ( type => 'Password' );
has_field 'password_confirm' => ( type => 'PasswordConf' );
has_field 'submit' => ( type => 'Submit', value => 'Register' );
has '+unique_messages' =>
( default => sub { { player_email => 'Email address already registered' } } );
no HTML::FormHandler::Moose;
__PACKAGE__->meta->make_immutable;
1
<----
I can then use this form class and make it an attribute of a controller like so:
---->
# Inside a controller...
use Bracket::Form::Register;
has 'register_form' => (
isa => 'Bracket::Form::Register',
is => 'rw',
lazy => 1,
default => sub { Bracket::Form::Register->new },
);
<----
Then when I want to use an instance of the register form in an action I do:
---->
# Inside the same controller...
sub register : Global {
my ( $self, $c ) = @_;
$c->stash(
template => 'form/auth/register.tt',
form => $self->register_form,
);
my $new_player = $c->model('DBIC::Player')->new_result( {} );
$self->register_form->process(
item => $new_player,
params => $c->request->parameters,
schema => $c->model('DBIC')->schema,
);
# This returns on GET (new form) and a POSTed form that's invalid.
return if !$self->register_form->is_valid;
# At this stage the form has validated
$c->flash->{status_msg} = 'Registration initiated';
$c->response->redirect( $c->uri_for('/login') );
}
<----
This form does validation and then inserts a record into the register table upon valid submission.mateus xaviermateus xavierhttp://cpanratings.perl.org/dist/mateus#6480
Rating: 4 stars
I had a long list of names that came in ALL CAPS. I wanted to convert them into their commonly written form. Doing ucfirst ( lc ($first_name) ) and ucfirst( lc ($last_name) ) goes along way to gettng the job done, but it does not address hyphenated names such as Smith-Jones nor does it address names with multiple words.
I could split on space and hyphen and then apply the ucfirst(lc()) to each word for multiple word names but that doesn't handle King James IV or names that start with Mc\U Mac\U O'\*. I searched CPAN for a more general solution and came across this module.
It does all the above case conversions, but has a few drawbacks in part due to the difficult nature of the problem: VAN and VAN DER get converted to van and van der always which may not always be correct.
There is a Spanish configuration option that makes el -> El and la -> La but it doesn't make de -> De or del -> Del. Again the letter case may vary depending on the owner of the name, but it would be nice to have more configuration options to choose to have all one way or the other.
For reference here's a basic function that does a lot of what this module does but not all:
sub name_case_converter {
my $name = shift;
$name = join ' ', map {
join '-', map { ucfirst( lc($_) ) } split /-/;
} split /\s+/, $name;
$name =~ s{^MC(.)}{Mc\U$1}mxsi;
$name =~ s{^O'(.)}{O'\U$1}mxsi;
return $name;
}mateus xaviermateus xavierhttp://cpanratings.perl.org/dist/mateus#6184
Rating: 5 stars
The Catalyst Restarter was recently improved and in the process it seems to consume more CPU. Installing this module was recommended on #catalyst for Linux kernels 2.6.13 or greater. It reduced CPU memory spikes from 22-25% to about 7-8% in my non-formal tests.
I highly recommend it.
mateus xaviermateus xavierhttp://cpanratings.perl.org/dist/mateus#5988
Rating: 5 stars
Easy management of fastcgi processes. Works like cake with Catalyst and Reaction apps. See POD and MojoMojo distribution for examples of usage but here is a synopsis:
* YAML Configuration file - myapp_fastcgi_manage.yml
---
- name: "myapp.server"
server_class: "FCGI::Engine::Manager::Server"
scriptname: "script/myapp_fastcgi.pl"
nproc: 3
pidfile: "/tmp/myapp.pid"
socket: "/tmp/myapp.socket"
* Process Control Script myapp_fastcgi_manage.pl
Adapt to your needs from FCGI::Engine::Manager Synopsis
* Restart fastcgi example:
script/myapp_fastcgi_manage.pl restart
mateus xaviermateus xavierhttp://cpanratings.perl.org/dist/mateus#3373
Rating: 5 stars
This review pertains to the Catalyst::Manual::Tutorial only because I have not read the majority of the remaining parts to the manual.
I found the tutorial very helpful in stepping me through a simple but real-world example that I could then extend for my needs. I like how the tutorial talks about building a Catalyst application via a combination of helper scripts and hand-coding. In addition framing Catalyst features/processes within MVC is helpful for clearing up my understanding of how the framework works.
From the initial App generation and database model construction to the controller details, debugging and testing, I find the tutorial a rather complete sketch of how to use Catalyst to build an MVC web application, debug it and test it. I really like the Test::WWW::Mechanize::Catalyst example to test not only on the unit level but also on the whole application level.
If you are trying to grasp the way to use Catalyst in your web application, then I highly recommend this tutorial.
mateus xaviermateus xavierhttp://cpanratings.perl.org/dist/mateus#2802
Rating: 5 stars
It makes it easy to setup dumping of variables and print statements.mateus xavier