A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Handle the database with Test::Class

package My::Test;

use base 'Test::Class';

sub startup : Tests(startup => 1) {
    $schema = NAP::PRL::Schema->connect( $dsn, $user, $password );
}

sub setup : Test(setup) {
    $schema->txn_begin;
}

sub teardown : Test(teardown) {
    $schema->txn_rollback;
}

Which version of Ubuntu?

Which version of Ubuntu should I install?

  • 11.04 - Yes! This works fine.
  • 11.10 - No. The menus are borked.

These are all the lovely settings you're missing in >11.04:

System preferences:



System administration:



Control centre:

Enable scrolling in GNU screen

.screenrc: 
termcapinfo xterm* ti@:te@ 


Install ruby gems

sudo yum -y install gcc ruby-devel rubygems
sudo gem install nokogiri

DBIx::Class basics

# SELECT COUNT(*) FROM product WHERE id = 104316
my $rs = $schema->resultset( 'Public::Product' )->search( { id => 104316 });
print "test: ".$rs->all;