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
use 5.010; | |
use List::Util qw/first/; | |
given ('foo') { | |
warn first { $_ eq 'foo' } qw/ bar baz /; # => bar | |
} |
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
use strict; | |
use warnings; | |
use Benchmark; | |
my %a = ( | |
foo => 1, | |
bar => 2, | |
baz => 3, | |
); |
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
sub foo { | |
my ($self, $args) = rule { | |
uri => { isa => 'Str', xor => [qw(schema host path_query)] }, | |
schema => { isa => 'Str', default => 'http' }, | |
host => { isa => 'Str', default => '127.0.0.1' }, | |
path_query => { isa => 'Str', default => '/' }, | |
method => { isa => 'Str', default => 'GET' }, | |
} @_; | |
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
$ perl bench-vs-mobile.pl docomo | |
docomo 1000 | |
(warning: too few iterations for a reliable count) | |
(warning: too few iterations for a reliable count) | |
Rate mobile emoji | |
mobile 4167/s -- -17% | |
emoji 5000/s 20% -- | |
$ perl bench-vs-mobile.pl kddi | |
kddi 1000 |
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
Index: t/mime_header_iso2022jp.t | |
=================================================================== | |
--- t/mime_header_iso2022jp.t (リビジョン 38732) | |
+++ t/mime_header_iso2022jp.t (作業コピー) | |
@@ -43,6 +43,9 @@ | |
is(encode('euc-jp', $utf8), $decoded); | |
is($header, $encoded); | |
+ | |
+ $utf8 = Encode::decode('MIME-Header-ISO_2022_JP', $header); |
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
diff --git a/lib/Encode/MIME/Header.pm b/lib/Encode/MIME/Header.pm | |
index 5f209b2..d61b589 100644 | |
--- a/lib/Encode/MIME/Header.pm | |
+++ b/lib/Encode/MIME/Header.pm | |
@@ -61,10 +61,10 @@ sub decode($$;$) { | |
}{ | |
if (uc($2) eq 'B'){ | |
$obj->{decode_b} or croak qq(MIME "B" unsupported); | |
- decode_b($1, $3, $chk); | |
+ $obj->decode_b($1, $3, $chk); |
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 PerlIO::via::Samurai; | |
use strict; | |
use warnings; | |
use Encode; | |
use Acme::Samurai; | |
sub import { | |
binmode STDOUT => ':via(Samurai)'; | |
} |
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 PerlIO::via::Ikamusume; | |
use strict; | |
use warnings; | |
use Encode; | |
use Acme::Ikamusume; | |
sub import { | |
binmode STDOUT => ':via(Ikamusume)'; | |
} |
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
--- | |
lib/Growl/Any.pm | 17 +++++++++++++++++ | |
1 files changed, 17 insertions(+), 0 deletions(-) | |
diff --git a/lib/Growl/Any.pm b/lib/Growl/Any.pm | |
index 5c1f909..916fdbd 100644 | |
--- a/lib/Growl/Any.pm | |
+++ b/lib/Growl/Any.pm | |
@@ -45,6 +45,23 @@ if (eval { require Mac::Growl; }) { | |
Mac::Growl::PostNotification($self->{name}, $event, $title, $message, 0, 0, $icon); |
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
use strict; | |
use warnings; | |
use Test::More; | |
use Text::Xslate; | |
my $tx = Text::Xslate->new( | |
syntax => 'TTerse', | |
function => { | |
return_array => sub { my @array = ('A'..'Z') }, | |
}, |