Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

mintywalker (7886)

mintywalker
  (email not shown publicly)
http://sysmonblog.co.uk/

Journal of mintywalker (7886)

Sunday July 19, 2009
11:00 AM

Moose sub types : one module or another

My initial problem:

How to tell Moose that an attribute was an instance of My::Class OR My::Test::Class.

Whaddaya know, there is more than one way to do it ;)

Seeing as how I got a lot of help from #moose on irc.perl.org I thought I'd write up my findings ...

How to create your own Moose sub types in Perl

. (There is a way to do it without creating a sub-type, but the sub-typing seemed a lot more interesting and general purpose that the specific solution to the original problem)

Saturday July 11, 2009
10:23 AM

Upgrading debian packages with newer cpan releases

I do all my cpan package/module management via debian's apt(itude) tool.

It works really well (for me) with one fairly major exception. Figuring out how to build packages/deb files is a bit complex.

It seems to be one of those problems that has so many different ways to do it and/or so many pitfalls that newbie dummies like me struggle. However once over that hurdle I have found using apt to be really nice.

After a lot of help from Aaron and faaar too many hours pulling out my hair I believe I have a process that generally works for me. So I thought I would share a worked example.

Upgrading libwww-perl via a Debian / Ubuntu deb package

It is hopefully a cleaner and tidier example of a post to london.pm about the same thing.

If anyone has any experience with building Debian/Ubuntu packages from cpan, I'd welcome some feedback.

ps. I'm aware of http://debian.pkgs.cpan.org/ but it doesn't always have what I want. I also find that the differently named packages sooner or later cause some kinda clash with the packages I get from Debian/Ubuntu.

pps. I'm also aware of dh-make-perl however that has caused me to trip up previously with version numbers.

For example the version of Spreadsheet::ParseExcel in Ubuntu Jaunty is 0.3300. The latest version on cpan is 0.49 and to make that work it's version in the debian package needs to be 0.4900. But dh-make-perl picks 0.49.

Plus, sometimes you want to tinker with the debian control files a little, and I've not yet figured out how to have it upgrade an existing module rather than build a new version (and loose all the changelog history from the debian package).

Again, via Aaron, I found the following to be rather helpful when figuring out what the version number wants to be for Debian

dpkg --compare-versions 0.3300 lt 0.4900 && echo yes || echo no

ppps. If you're more a redhat / fedora kinda person then perhaps this might be of interest