Skip to content

Instantly share code, notes, and snippets.

: block main -> {}
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),
{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
{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
{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
{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
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;
+
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;
#!/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;
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,