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 do I from inside foo distinguish the calls, to treat the first param magically? | |
# print example: | |
$ perl -wle 'print sub{*STDOUT},"a", "b";' |
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; | |
my @interesting_keys = qw/a/; | |
my $hash_list = [ { a => 1, b => 1 }, { a => 2 } ]; | |
my $new_hash_list = [ | |
map { | |
my $dest = $_; |
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 Around; | |
use Mojo::Util qw/trim/; | |
use Moose; | |
has "trimmed" => (is => 'rw', isa => 'Str'); | |
around "trimmed" => sub { | |
my ($orig, $self, $str) = @_; |
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 -l | |
use strict; | |
use warnings; | |
use Mojo::Util; | |
use Mojo::Collection; | |
Mojo::Util::monkey_patch('Mojo::Collection', sort_by_order => sub { | |
my ($self, $order, $cb) = @_; |
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 -l | |
use strict; | |
use warnings; | |
use Mojo::Util; | |
use Mojo::Collection; | |
Mojo::Util::monkey_patch('Mojo::Collection', sort_by_attr_order => sub { | |
my ($self, $attr, $order) = @_; |
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
+++ b/lib/Startsiden/Build/Database/Schema/Ci.pm | |
@@ -31,7 +31,6 @@ __PACKAGE__->belongs_to('svnrepo','Startsiden::Build::Database::Schema::Svnrepo' | |
__PACKAGE__->belongs_to('packageinfo','Startsiden::Build::Database::Schema::Packageinfo', 'packageinfo_id', | |
{join_type => 'left', } | |
); | |
-__PACKAGE__->has_many('citeststatus','Startsiden::Build::Database::Schema::CiTeststatus','ci_id'); | |
__PACKAGE__->has_many('history', 'Startsiden::Build::Database::Schema::CiHistory', 'ci_id', { | |
order_by => 'ts DESC', | |
rows => 40 |
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
$ cat test.pl | |
#!/usr/bin/perl -dl | |
{ | |
use DB; | |
*DB::DB = sub { | |
my ($p, $f, $l) = caller; | |
print "> " . @{"::_<$f"}[$l] unless caller(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
2016/04/12 14:24:07 [TRACE] Build.Debian.Base.bootsh.STDOUT Perl.pm:build_make 531> [12:24:07] t/aggregate/unit_core_script_run_options.t ............................ ok 871 ms | |
2016/04/12 14:24:07 [TRACE] Build.Debian.Base.bootsh.STDOUT Perl.pm:build_make 531> [12:24:07] t/aggregate/unit_core_script_server-without_modules.t ................. skipped: Need Test::Without::Module for this test | |
2016/04/12 14:24:08 [TRACE] Build.Debian.Base.bootsh.STDOUT Perl.pm:build_make 531> [12:24:08] t/aggregate/unit_core_script_server.t ................................. ok 625 ms | |
2016/04/12 14:24:08 [TRACE] Build.Debian.Base.bootsh.STDOUT Perl.pm:build_make 531> [12:24:08] t/aggregate/unit_core_scriptrunner.t .................................. ok 514 ms | |
2016/04/12 14:24:09 [DEBUG] Build.Debian.Base.bootsh.STDERR Perl.pm:build_make 531> Term::Size::Any is not installed, can't autodetect terminal column width | |
2016/04/12 14:24:09 [TRACE] Build.Debian.Base.bootsh.STDOUT Perl.pm:build_make 531> [12:24:09] t/aggrega |
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
libraries $ cover -test | |
---------------------------- ------ ------ ------ ------ ------ ------ ------ | |
File stmt bran cond sub pod time total | |
---------------------------- ------ ------ ------ ------ ------ ------ ------ | |
RG/BasePackage.pm 83.1 70.4 67.4 94.7 91.6 4.8 78.8 | |
RG/CDN.pm 92.0 59.7 37.5 100.0 70.0 21.9 78.2 | |
RG/Charter/Index.pm 13.6 0.0 0.0 35.7 85.7 0.0 12.8 | |
RG/Charter/Search.pm 75.6 52.3 56.7 88.5 100.0 0.4 67.7 | |
RG/Config.pm 35.7 17.7 28.5 52.9 100.0 0.0 34.2 | |
RG/Content/Wordpress.pm 78.9 n/a 22.2 73.3 100.0 0.0 72.8 |
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:/projects/Reisegiganten $ cloc libraries backend --by-file | |
523 text files. | |
476 unique files. | |
7534 files ignored. | |
http://cloc.sourceforge.net v 1.60 T=1.30 s (267.0 files/s, 58196.2 lines/s) | |
------------------------------------------------------------------------------------------------------------------------------ | |
File blank comment code | |
------------------------------------------------------------------------------------------------------------------------------ | |
libraries/t/Supplier/API/apollo_hotel_test_data_hotel-id_328870.xml 6 0 1847 |