Skip to content

Instantly share code, notes, and snippets.

View perigrin's full-sized avatar

Chris Prather perigrin

View GitHub Profile
import os
PATCHIDCACHE={}
def getpatchid(commit):
if commit in PATCHIDCACHE:
return PATCHIDCACHE[commit]
r = os.popen("git-diff-tree -p %s | git-patch-id" % commit).read().strip().split()
if r:
PATCHIDCACHE[commit] = r
return r
#!/usr/bin/env python
REPOPATH="/home/andersg/xmms2-mergetest"
OUTPUTFILE="/var/www/git.xmms.se/merge/index.html"
#OUTPUTFILE="/tmp/merge.html"
BASEREMOTE="origin"
BASEBRANCH=BASEREMOTE + "/master"
import os

Inside Web.PM

use Catalyst qw(
…
Authentication
…
)


__PACKAGE__->config(
#!/usr/bin/env perl
use strict;
use warnings;
my $package = get_package( path => $ENV{TM_FILEPATH}, walk_up_to => 'lib' );
my $content = get_content();
if ($content) {
$content =~ s/^package (.*?);/package $package;/;
print $content;
sub find_in_box {
my ( $self, $box ) = @_;
my $where = {
longitude =>
[ -and => { '<', \$box->{min_lon} }, { '>', \$box->{max_lon} } ],
latitude =>
[ -and => { '>', \$box->{min_lat} }, { '<', \$box->{max_lat} } ],
};
$self->directory->search($where);
}
2006-03-04T18:08:56|Stevan Little
2006-04-17T15:30:26|Christian Hansen
2006-04-21T18:22:23|Yuval Kogman
2006-08-06T00:29:03|Eric Wilhelm
2006-09-07T05:59:54|Adam Kennedy
2006-11-21T23:33:01|Todd Hepler
2007-01-24T18:47:46|Jess Robinson
2007-03-22T19:00:17|Anders Nor Berle
2007-03-24T18:05:20|Robert 'phaylon' Sedlacek
2007-04-05T21:40:37|Scott McWhirter

So [Dave Cross][1] has started injecting Moose Koolaid into his CPAN modules and got smacked by [Adam Kennedy][2] for injecting Moose into something with a ton of downstream dependencies. Or at least it used to have a ton of downstream deps, the module in question, [Test::Warn][3] (as Adam rightly points out) has moved on.

Adam's Moose complaints are two fold. It "adds a huge amount of additional dependencies", and "the slower process startup time". These are the two standard complaints about Moose, along with "Ahh My RAM!!!".

In one of the comments on Dave Cross's hotly debated "Moose or No Moose" post someone said:

To those who claim Moose is usable in command-line commands, please can you get Moose developers to stop saying otherwise, cos it's hard not to take their claims seriously.

I'm a core Moose developer. I use Moose for command line apps, almost exclusively. MooseX::Getopt is by far the easiest way I have ever found to write a command line app. MooseX::AppCmd and several other modules only make it better.

That said, I cannot in good faith recommend Moose for command line applications because there is an overhead where Moose will take by some estimates 0.2s (I haven't measured this recently) longer to start up than an equivalent non-Moose app. That 0.2s can be a show stopper for some environments where lots of processes are started up very quickly. You get 1500 processes starting up 0.2s slower each th

Okay the last thing that came up in Dave Cross's now infamous Moose or No Moose post. This post comes last because I noticed the question last but it also took the longest to write. The questions is about the idea that is Moose the One True Way. To quote the original Poster:

Define "do OO right". Any answer containing explicit reference to Moose will be disqualified.
20:49 < szabgab> some time ago there was a post on how Java allows ISVs and
many people to make money while Perl (and in general other OS
languages) not ; Can someone point me at that post?
20:53 < szabgab> oh, I knew I have to come here and ask it
20:53 < szabgab> as I just found it :-)
20:53 < szabgab> http://mechanicalrevolution.com/blog/dynamic_languages_and_money.html
20:58 < mst> it's an interesting concept
20:58 < mst> the ecosystem is definitely different for OSS based languages
21:00 < szabgab> I wonder how we in the Perl community could help others to
make money on Perl and on CPAN modules