Skip to content

Instantly share code, notes, and snippets.

# CPAN Name : Modern-Perl
[% WRAPPER wrapper.tt %]
build() {
DIST_DIR="${srcdir}/[% distdir %]"
export PERL_MM_USE_DEFAULT=1
{ cd "$DIST_DIR" &&
[% IF is_makemaker %]
perl Makefile.PL INSTALLDIRS=vendor &&
make &&
[% IF skiptest %]#[% END %]make test &&
#!/usr/bin/perl
use warnings;
use strict;
use 5.010;
use File::Spec::Functions qw(catfile);
sub make_inc_hook
From 8e993c74faf873d159dcedfe90ae323930312663 Mon Sep 17 00:00:00 2001
From: Justin Davis <jrcd83@gmail.com>
Date: Fri, 14 May 2010 20:38:46 -0700
Subject: [PATCH] Fix broken -I option for plackup.
Explicitly 'require lib' before we try to use lib->import.
---
lib/Plack/Runner.pm | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
# CPAN Name : Module-Install
# Contributor: [% packager %]
# Generator : CPANPLUS::Dist::Arch [% version %]
pkgname='[% pkgname %]'
pkgver='[% pkgver %]'
pkgrel='[% pkgrel %]'
pkgdesc="[% pkgdesc %]"
arch=('[% arch %]')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
#!/usr/bin/perl
# Requires my ALPM perl module, which will probably break when pacman
# 3.4.0 comes out... unless I have time to hack on ALPM before then.
use warnings;
use strict;
use 5.010;
use ALPM;
# Project Euler Problem #4
# Find the largest palindrome in perl6
use v6;
# This probably takes about 10 minutes to complete?
(my @alpha) = (my @beta) = reverse (100..999);
my $max = 0;
for @alpha -> $x {
sub foobar
{
my ( $cgi ) = @_;
my $data = {};
my $store = sub {
my $name = shift;
return $data->{ $name } = $cgi->param( $name );
};
#!/usr/bin/perl
use warnings;
use strict;
use version;
my @data_sources = ( [ 'qv()' => sub { qv( shift ) } ],
[ 'version->new()' => sub { version->new( shift ) } ],
);
(defun search-backward-for-my (point)
(goto-char point)
(save-match-data
(catch 'found-my
(while t
(unless (re-search-backward "\\bmy\\b" 0 t)
(throw 'found-my nil))
(when (eq (get-text-property (point) 'face) 'font-lock-keyword-face)
(throw 'found-my (point)))))))
@juster
juster / gist:744186
Created December 16, 2010 23:09
treeprint.ml
type tree = Tree of (string * tree list) | Leaf of string
(* Create a list of line repeated count times *)
let rec repeat_line line count =
match count with 0 -> [] | _ -> line :: (repeat_line line (count - 1))
(* Appends blank lines which are filled with spaces *)
let append_blank_lines lines count =
let width = String.length (List.hd lines) in
let blankline = String.make width ' ' in