This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
## | |
# モジュールのバージョンをしらべる | |
# ./chpmv Moose Mouse Any::Moose Data::Dumper ... | |
use warnings; | |
use strict; | |
use 5.009004; | |
use Module::Load; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // vim: ts=4 sts=4 sw=4 | |
class HashRename | |
{ | |
/*** | |
* hash_rename | |
* | |
* @params Hash $hash | |
* @params Hash $rule | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // vim: ts=4 sts=4 sw=4 | |
class AppRegistry | |
{ | |
private static $instance; | |
private $registry = array( ); | |
static function instance ( ) | |
{ | |
if ( !isset(self::$instance) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // vim: ts=4 sts=4 sw=4 | |
class Mixin | |
{ | |
private $mixins = array( ); | |
private $strict = false; | |
function __construct ($include=array( )) | |
{ | |
if ( !is_array($include) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // vim: ts=4 sts=4 sw=4 | |
class SimpleConfigLoader | |
{ | |
private $config = array( ); | |
private $section = null; | |
private $loaded = array( ); | |
function __construct ($path, $section=null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Hoge; | |
use Data::Dumper; | |
use Mouse; | |
use MouseX::Types::Mouse qw/ ArrayRef Str /; | |
has hoge => ( | |
is => 'rw', | |
isa => ArrayRef[Str], # -- Syntax Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- てすと きっとやっちゃいけない。 --> | |
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> | |
<ShortName>アルク辞書検索</ShortName> | |
<Description>アルク辞書検索</Description> | |
<InputEncoding>UTF-8</InputEncoding> | |
<Image width="16" height="16">data:text/plain;base64,AAABAAIAEBAAAAAAAABoBQAAJgAAACAgAAAAAAAAqAgAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD/gAAA/8KGAP+bNwD/3bsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Model; | |
use DBIx::Skinny; | |
{ | |
# 再定義したときの警告がでないようにするためのオマジナイ | |
no warnings 'redefine'; | |
# row クラスを作成しているメソッドを再定義 | |
*_mk_row_class = sub { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Model; | |
use DBIx::Skinny; | |
use MyApp::Model::Iterator; | |
{ | |
no warnigns 'redefine'; | |
*_get_sth_iterator = sub { | |
my ($class, $sql, $sth, $opt_table_info) = @_; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## t/050_mixin/find_or_create.t | |
# ---------- >8 ---------- | |
do { | |
eval { | |
$model->find_or_create( | |
test5 => { '' => 'key1' } => { | |
data => 'data2', | |
} |
OlderNewer