Skip to content

Instantly share code, notes, and snippets.

@kits
kits / AquesTalk.pm
Created December 6, 2010 08:49
AquesTalk.pm - use AquesTalk library with perl.
package AquesTalk;
use Any::Moose;
use Win32::API;
use Encode ();
our $VERSION = '0.02';
# error messages
@kits
kits / mycpanm
Created November 12, 2010 21:43
mycpanm (use 02packages.details.txt.gz, instead of cpanmetadb)
#!/usr/bin/env perl
use strict;
use File::Spec;
load_cpanm();
*App::cpanminus::script::search_module = sub {
my ($self, $module) = @_;
my $PKGS = '02packages.details.txt.gz';
@kits
kits / myperlbrew.patch
Created November 10, 2010 13:39
myperlbrew.patch (use a favorite mirror site, instead of search.cpan.org)
*** ./perlbrew 2010-11-05 08:56:08.156250000 +0900
--- perl5/perlbrew/bin/perlbrew 2010-11-10 22:33:48.046875000 +0900
***************
*** 1116,1125 ****
unless ($dist_git_describe) {
my $mirror = $self->conf->{mirror};
my $header = $mirror ? { 'Cookie' => "cpan=$mirror->{url}" } : undef;
! my $html = $self->_http_get("http://search.cpan.org/dist/$dist", undef, $header);
! ($dist_path, $dist_tarball) =
@kits
kits / gist:670759
Created November 10, 2010 11:58
perl-5.12.2 t/op/mkdir fails (in LANG=ja)
t/op/magic.....................................................ok
t/op/method....................................................ok
t/op/mkdir.....................................................# Failed at op/mkdir.t line 20
# got 'ファイルが存在します。'
# expected /(?i-xsm:cannot move|exist|denied|unknown)/
# Failed at op/mkdir.t line 24
# got 'ファイルもディレクトリもありません。'
# expected /(?i-xsm:cannot find|such|exist|not found|not a directory|unknown)/
FAILED at test 3
t/op/my........................................................ok
@kits
kits / gist:668933
Created November 9, 2010 10:18
extract "fatpacked" module in cpanm.
#!perl
use strict;
use warnings;
use PadWalker qw(peek_sub);
require 'path/to/cpanm';
my $extract_to = 'lib';
my $fatpacked = peek_sub($INC[0])->{'%fatpacked'};
@kits
kits / podview.pl
Created October 5, 2010 23:29
POD Viewer
#!/usr/bin/env perl
### PodV start ###
package PodV;
use strict;
use warnings;
no warnings 'redefine';
use Encode qw(decode FB_HTMLCREF);
use Pod::Perldoc;