Skip to content

Instantly share code, notes, and snippets.

has 'user' => (is => 'ro', isa => 'Str', default => 'nobody');
has 'group' => (is => 'ro', isa => 'Str', default => 'nogroup');
after 'daemonize' => sub {
my $self = shift;
return unless $self->is_daemon;
return unless (defined $self->user and defined $self->group);
my $uid = getpwnam($self->user) or $self->log->error( "cannot find uid for username: " . $self->user);
my $gid = getgrnam($self->group) or $self->log->error("cannot find gid for group: " . $self->group);
#!/usr/bin/perl
use strict;
use warnings;
use Net::DNS;
my $res = Net::DNS::Resolver->new;
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dump qw/dump/;
use List::Uniq 'uniq';
my %pkgs;
#!/usr/bin/perl
use Search::Xapian;
my $doc = Search::Xapian::Document->new();
my $tg = Search::Xapian::TermGenerator->new();
$tg->set_document($doc);
repo layout:
tags/
Component-A-0.12
Component-B-0.15
branches/
BUG-123/
Feature-X
experiment-omega
trunk/
#!/usr/bin/perl -w
package Role;
use Moose::Role;
has '_default_rows' => (is => 'rw', isa => 'Int');
after 'BUILD' => sub {
my $self = shift;
$self->_default_rows($self->rows);
};
sub BUILD {}
#!/usr/bin/perl -w
use strict;
use Test::More tests => 7;
use WWW::Curl::Easy;
use HTTP::Request;
my $url = 'http://en.wikipedia.org/wiki/Main_Page';
my $req = HTTP::Request->new( GET => $url );
isa_ok( $req, 'HTTP::Request' );
## This is my attempt at writing a simple grammar in perl6
class EasyCMS::Template {
method render (Str $in, %vars) {
EasyCMS::Template::Grammar.parse($in)
or fail "could not parse: $in";
#$in ~~ /EasyCMS::Template::Grammer::TOP/;
my $s;
for $/<token>.values -> $token {
andreas:~/Projects/work$ svk mirror http://svn.startsiden.no/svn/Novus //startsiden/novus
//startsiden/verden-search is not a mirrored path.
andreas:~/Projects/work$ svk list //startsiden/verden-search
Path /startsiden/verden-search is not versioned.
andreas:~/Projects/work$ svk list //startsiden
abcsok-Common/
abcsok-rewrite/
bilder-search/
blog/
bolavbin/
PerlRequire etc/mod_perl_startup.pl