background preloader

My Perl

Facebook Twitter

KpNemo.ws / Разное Other / Rated X #2: She's Gotta Have It. SimpleLogin. CatalystX::SimpleLogin::Manual - How to use and customise CatalystX::SimpleLogin.

SimpleLogin

We're using a sample application here, to make the instructions a little easier. This assumes that you have Catalyst, Catalyst::Devel, Template Toolkit, and the Catalyst authentication and session plugins installed. catalyst.pl MyApp cd MyApp script/myapp_create.pl view HTML TT Edit lib/MyApp.pm and add CatalystX::SimpleLogin, Authenticate, and the Session plugins to the use Catalyst plugin list: use Catalyst qw/-Debug ConfigLoader +CatalystX::SimpleLogin Authentication Session Session::Store::File Session::State::Cookie Static::Simple/; Add the following config for authentication, including two sample users: __PACKAGE__->config( 'Plugin::Authentication' => { default => { credential => { class => 'Password', password_field => 'password', password_type => 'clear' }, store => { class => 'Minimal', users => { bob => { password => "bobpw", }, william => { password => "billpw", }, }, }, }, }, ); Authorization.

Perlbrew, Emacs, Flymake. So I’m a seasoned user of Emacs (I started using it back to 1999).

Perlbrew, Emacs, Flymake

I’m using it for all things, especially Perl coding, using the cperl-mode Emacs mode. Lately, I’ve come to using flymake. Flymake is a tool in Emacs, which tries to compile the file you are editing, and displays compilation errors in your buffer. There is a mode for Perl, so the result is really nice : realtime syntax checking of the current Perl file you’re editing. It looks like that : Then comes perlbrew, which allows you to have multiple Perl interpretors installed on your machine, and switching between them easily. Alas, flymake is not working by default with Perlbrew, as it uses /usr/bin/perl. Kentaro has made a Perlbrew mode, and explained how to use it with flymake. However, for various reasons, this Perlbrew mode it doesn’t work well on my machine and Franck ( lumperjaph ) reported similar issues.

So I went on and rewrote a simple Perlbrew mode that would do almost nothing.

Catalys

5.10 and Newer. 20-PERL-Tips at Programmers Heaven. Ten Essential Development Practices. The following ten tips come from Perl Best Practices, a new book of Perl coding and development guidelines by Damian Conway. 1.

Ten Essential Development Practices

Design the Module's Interface First The most important aspect of any module is not how it implements the facilities it provides, but the way in which it provides those facilities in the first place. If the module's API is too awkward, or too complex, or too extensive, or too fragmented, or even just poorly named, developers will avoid using it. They'll write their own code instead. Designing module interfaces requires both experience and creativity. The key, however, is to write that code as if the module were already available, and write it the way you'd most like the module to work. Once you have some idea of the interface you want to create, convert your "play tests" into actual tests (see Tip #2). 2. Probably the single best practice in all of software development is writing your test suite first. Write the tests first. 3. 4. 5. > substrate --help 6.