Perlの小ネタ7連発
TIME rest time current/total
TopicsPlaceHolder

Perlの小ネタ7連発

Gotanda.pm #4

Mar 25th, 2015

Profile

songmu

Mackerel Logo

 

1. App::KV2JSON

2. App::LJ

3. fatpacker-simple

4. vanilla-perl

簡単にvanilla-perlを作成

plenv install 5.20.2 -j4 -ddebugging=-g --as 5.20-vanilla -dman1dir=none -dman3dir=none
curl -l https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm > $home/.plenv/versions/5.20-vanilla/bin/cpanm
chmod +x $home/.plenv/versions/5.20-vanilla/bin/cpanm
chmod -r -w $home/.plenv/versions/5.20-vanilla/lib/perl5/site_perl

alias vanilla-perl="env PLENV_VERSION=5.20-vanilla plenv exec perl"

5. Test::MockTimeを使うときのハック

ちゃんとエラーになるようにする

Test::MockTimeを直接使うのではなく、プロジェクト用のラッパーを作る

package MyApp::Test::MockTime;
use Test::MockTime ();
BEGIN {
    die 'You must do `use MyApp::Test::MockTime` before `use Time::Piece;`' if $INC{'Time/Piece.pm'};
}

sub import {
    Test::MockTime->export_to_level(1, @_);
}

use MyApp::Test::MockTime などとして使う。

6. プレゼンツールのスマホ操作

7. strrand

以上

We are Hiring

hatena