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
button.tx | |
<span class="button"><: $name :></span> | |
hoge.tx | |
:include 'button.tx' {name => '<p>hogehoge</p>' | mark_rawk} |
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
PDOからよばれるreal_escape_stringで文字コードを考慮させたい場合は | |
$dbh = new PDO('mysql:host=localhost;dbname=sandbox;charset=cp932', 'sandbox', 'sandbox', array( | |
PDO::MYSQL_ATTR_READ_DEFAULT_FILE => '/etc/mysql/my.cnf', | |
PDO::MYSQL_ATTR_READ_DEFAULT_GROUP => 'client', | |
)); | |
もしくはserver-side-prepareを使う場合(文字コード気にしなくておk) | |
$dbh = new PDO('mysql:host=localhost;dbname=sandbox;charset=cp932', 'sandbox', 'sandbox', array( | |
PDO::ATTR_EMULATE_PREPARES => false, |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
# Usage: cpan-outdated -v | diffchanges.pl | |
use LWP::UserAgent; | |
use Algorithm::Diff; | |
my $ua = LWP::UserAgent->new; |
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
diff --git a/lib/Plack/Handler/Starlet.pm b/lib/Plack/Handler/Starlet.pm | |
index 700b181..fddb6bd 100644 | |
--- a/lib/Plack/Handler/Starlet.pm | |
+++ b/lib/Plack/Handler/Starlet.pm | |
@@ -26,7 +26,7 @@ sub new { | |
$listen_sock->fdopen($fd, 'w') | |
or die "failed to bind to listening socket:$!"; | |
} | |
- my $max_workers = delete($args{max_workers}) || 10; | |
+ my $max_workers = delete($args{max_workers}) || delete($args{workers}) || 10; |
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
diff --git lib/Plack/Loader/Restarter.pm lib/Plack/Loader/Restarter.pm | |
index 4a79bbd..f4051be 100644 | |
--- lib/Plack/Loader/Restarter.pm | |
+++ lib/Plack/Loader/Restarter.pm | |
@@ -23,6 +23,8 @@ sub watch { | |
sub _fork_and_start { | |
my($self, $server) = @_; | |
+ $self->{pid} = undef; | |
+ |
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
{chiba}% perl benchmark/others.pl --pp --booster [~/git/github/gfx/p5-Text-Xslate] | |
testing with PP | |
Perl/5.12.1 i686-linux | |
Text::Xslate/0.1054 | |
Text::MicroTemplate/0.15 | |
Template/2.22 | |
Text::ClearSilver/0.10.5.4 | |
HTML::Template::Pro/0.9502 | |
1..5 | |
ok 1 - TT: Template-Toolkit |
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
{chiba}% perl benchmark/others.pl --p --booster | |
testing with PP | |
Perl/5.12.1 x86_64-linux | |
Text::Xslate/0.1054 | |
Text::MicroTemplate/0.15 | |
Template/2.22 | |
Text::ClearSilver/0.10.5.4 | |
HTML::Template::Pro/0.9502 | |
1..5 | |
ok 1 - TT: Template-Toolkit |
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
{chiba}% MOUSE_PUREPERL=0 perl benchmark/others.pl --pp | |
testing with PP | |
Perl/5.12.1 x86_64-linux | |
Text::Xslate/0.1054 | |
Text::MicroTemplate/0.15 | |
Template/2.22 | |
Text::ClearSilver/0.10.5.4 | |
HTML::Template::Pro/0.9502 | |
1..5 | |
ok 1 - TT: Template-Toolkit |
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
{chiba}% perl benchmark/others.pl | |
Perl/5.12.1 x86_64-linux | |
Text::Xslate/0.1054 | |
Text::MicroTemplate/0.15 | |
Template/2.22 | |
Text::ClearSilver/0.10.5.4 | |
HTML::Template::Pro/0.9502 | |
1..5 | |
ok 1 - TT: Template-Toolkit | |
ok 2 - MT: Text::MicroTemplate |
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
diff --git lib/Text/Xslate.pm lib/Text/Xslate.pm | |
index b2f65a9..4de8ec1 100644 | |
--- lib/Text/Xslate.pm | |
+++ lib/Text/Xslate.pm | |
@@ -228,7 +228,7 @@ sub find_file { | |
$cachepath = File::Spec->catfile( | |
$self->{cache_dir}, | |
- Text::Xslate::uri_escape(ref($p) ? ref $p : $p), | |
+ Text::Xslate::uri_escape(ref($p) ? ( overload::Method($p, q{""}) ? "$p" : ref $p ) : $p), |