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 MyClass; | |
sub new { | |
my ( $class, $dsn, $user, $password ) = @_; | |
my $self = bless {}, $class; | |
my $self->{dbh} = DBI->connect($dsn, $user, $password); |
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 MyClass; | |
sub new { | |
my ( $class ) = @_; | |
my $self = bless {}, $class; | |
$self->{dbh} = DBI->connect( 'DBI:mysql:database=db', 'dbuser', 'dbpassword' ); |
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
around psgi_callback => sub { | |
my $orig = shift; | |
my $self = shift; | |
my $cascade = Plack::App::Cascade->new; | |
my $favicon_c = Plack::App::Cascade->new; | |
for my $root ( $self->static_roots ){ | |
$cascade->add( Plack::App::File->new(root => $root )->to_app ); | |
$favicon_c->add( Plack::App::File->new( file => "$root/images/favicon.ico" )->to_app ); | |
}; | |
my $app = Plack::App::URLMap->new; |
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 Devel::Peek; | |
binmode(STDOUT,":utf8"); | |
for my $letter ( "\x{0411}", 'A' ){ | |
print "Letter $letter\n"; | |
Dump $letter; | |
if( $letter =~ /p{Latin}/ ){ | |
print "matched p{Latin}: $1\n"; |
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 MyApp; | |
my $app = MyApp->new(); | |
$app->psgi_callback; |
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 psgi_callback { | |
my $self = shift; | |
sub { | |
my $req = Plack::Request->new( shift ); | |
$self->handle( $req ); | |
}; | |
} |
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 Plack::Request; | |
sub { | |
my $env = shift; | |
# eval { die 'aaaaaaaaaaaaaaaaaaaa'; }; | |
return [ | |
'500', | |
[ 'Content-Type' => 'text/plain' ], |
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
has_field 'date_time' => ( | |
type => 'Compound', | |
apply => [ | |
{ | |
transform => sub { DateTime->new( shift ) }, | |
message => 'This is not a correct date', | |
} | |
{ | |
check => sub { shift->day_of_week == 1 }, | |
message => 'Only Mondays allowed', |
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
zby@zby:~/progs/Enzyme$ cpanp i Some::Module | |
Computing prerequisites. | |
You have unmet external prerequisites: | |
memcached | |
xslt version 1.1.18 | |
... | |
Please install the prerequisites first then run the installation again. |
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
zby@zby:~/progs/Enzyme$ cpanp i Cache::Memcached::Managed | |
Installing Cache::Memcached::Managed (0.20) | |
Running [/home/zby/local/bin/perl /usr/local/bin/cpanp-run-perl /home/zby/.cpanplus/5.10.1/build/Cache-Memcached-Managed-0.20/Makefile.PL]... | |
No executable memcached found: No such file or directory | |
Running [/usr/bin/make test]... | |
PERL_DL_NONLAZY=1 /home/zby/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t | |
Can't exec "memcached": No such file or directory at /home/zby/.cpanplus/5.10.1/build/Cache-Memcached-Managed-0.20/blib/lib/Cache/Memcached/Managed.pm line 843. | |
# | |
# Stopped memcached server | |
# Looks like you planned 176 tests but ran 184. |