This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use Test::More; | |
| use IO::ScalarArray; | |
| use ExtUtils::MakeMaker qw(prompt); | |
| { | |
| my $stdin = IO::ScalarArray->new(["hoge\n"]); | |
| local *STDIN = *$stdin; | |
| my $hoge = prompt("set: ", 1); | |
| ok $hoge; |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use Benchmark qw(:all); | |
| print "splice(), each(), keys(), values() Benchmark!!\n"; | |
| my %mapping = my @mapping = map {$_ => $_} (1..100); | |
| cmpthese -1, { | |
| splice => sub { | |
| while (my ($key, $value) = splice @mapping, 0, 2) {} |
This file contains hidden or 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
| sub hoge (&) { | |
| my ($callback) = @_; | |
| $callback->(); | |
| } | |
| # subがない | |
| hoge { | |
| print "hisada\n"; | |
| }; |
This file contains hidden or 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::Web; | |
| use strict; | |
| use warnings; | |
| use parent qw(Malts Malts::Web); | |
| sub startup { | |
| my ($self) = @_; | |
| MyApp::Web::Dispatcher->dispatch($self) or $self->not_found; | |
| } |
This file contains hidden or 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 Plack::Request::Cached; | |
| use 5.008_001; | |
| use strict; | |
| use warnings; | |
| use Variable::Magic qw/cast wizard VMG_OP_INFO_NAME/; | |
| use Scalar::Util qw/refaddr weaken/; | |
| use Class::Method::Modifiers::Fast qw(install_modifier); | |
| use Data::Util qw(install_subroutine get_code_ref); | |
| use Plack::Request; |
This file contains hidden or 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
| use Devel::Symdump; | |
| use Amon2::Web; | |
| print Devel::Symdump->new('Amon2::Web')->as_string; |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use Data::Wheren::7Bit; | |
| sub say { | |
| print @_, "\n"; | |
| } | |
| my $wheren = Data::Wheren::7Bit->new; | |
| my $lat = 35.3137; |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Test::More; | |
| use DBI; | |
| use DBIx::Unko; | |
| my $dbh = DBI->connect(...); | |
| my $unko = DBIx::Unko->new(dbh => $dbh, namespace => 'Geri'); | |
| my $geri = $unko->create_factory( |
This file contains hidden or 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
| testtetstest |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| package Fuga; | |
| sub fuga { "1" } | |
| package main; | |
| use Data::Dumper; | |
| my $hoge = \&Fuga::fuga; |
OlderNewer