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 RG::BackendConfig; | |
use strict; | |
use warnings; | |
use Moo; | |
extends 'RG::Config'; | |
has '+name' => ( is => 'ro', default => 'reisegigantenadmin'); |
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
---------- Forwarded message ---------- | |
From: Andreas Marienborg <[email protected]> | |
Date: 2015-06-02 16:42 GMT+07:00 | |
Subject: Re: Forespørsel om å utgi utvalgte biblioteker som åpen kildekode | |
To: Nicolas Mendoza <[email protected]> | |
Cc: [email protected] | |
Hey, |
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/Reisegiganten.pm b/lib/Reisegiganten.pm | |
index 31fd492..5614df3 100644 | |
--- a/lib/Reisegiganten.pm | |
+++ b/lib/Reisegiganten.pm | |
@@ -188,7 +188,7 @@ sub setup_attrs { | |
my ($self) = @_; | |
$self->attr( 'db_config' => sub { RG::Config->new; }); | |
- $self->attr( 'cache' => sub { CHI->new( driver => 'FastMmap', cache_size => '10m', root_dir => '/tmp/mmap_' . __PACKAGE__, expire_time => '10m', expires_in => '10 min', expires_variance => 0.1 )}); | |
+ $self->attr( 'cache' => sub { CHI->new( $ENV{NO_CACHE} ? ( Driver => 'Null' ) : $self->config->{cache} ) }); |
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::Base; | |
use Moose; | |
has 'abc' => ( is => 'ro', lazy => 1, default => 'def', reader => 'get_abc' ); | |
has 'xyz' => ( is => 'ro', lazy => 1, default => 123, reader => 'get_xyz' ); | |
around [qw/get_abc get_xyz/] => sub { | |
my ($orig, $self) = shift; | |
return "base: " . $self->$orig; |
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
autocmd BufWritePre *.{pm,t,pl} call StripTrailingWhite() | |
function! StripTrailingWhite() | |
let l:winview = winsaveview() | |
silent! %s/\s\+$// | |
call winrestview(l:winview) | |
endfunction |
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/perl | |
use v5.10; | |
=o_O= | |
.__. | |
=cut | |
say "funpod"; |
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
$ perl -wlE 'say $]; &CORE::warn(1)' | |
5.022002 | |
1 at -e line 1. | |
$ perl -wlE 'say $]; &CORE::warn(1)' | |
5.014002 | |
Undefined subroutine &CORE::warn called at -e line 1. |
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
nicolasm@tipsy:/tmp $ cat Foo.pm | |
package Foo; | |
use Moo; | |
has 'path' => ( is => 'lazy', default => sub { return __FILE__ } ); | |
1; | |
nicolasm@tipsy:/tmp $ cat SubFoo.pm | |
package SubFoo; | |
use Moo; | |
extends 'Foo'; |
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/perl | |
use Data::Dumper; | |
local $Data::Dumper::Indent = 0; | |
package A; | |
use Moo; | |
has a => (is => "ro"); | |
has b => (is => "ro", lazy => 1, default => sub { shift->a + 1 }); |
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
$ perl -wle 'sub foo (&$*) { print "@_"; } foo(sub {*STDOUT},"a", "b");' | |
CODE(0x2561da8) a b | |
$ perl -wle 'sub foo (&$*) { print "@_"; } foo {*STDOUT} "a", "b";' | |
CODE(0x184ed68) a b | |
# How can I from inside the sub distinguish the calls? | |
# print example: | |
$ perl -wle 'print sub{*STDOUT},"a", "b";' |