Skip to content

Instantly share code, notes, and snippets.

View avar's full-sized avatar

Ævar Arnfjörð Bjarmason avar

View GitHub Profile
sub register_prereqs {
my $self = shift;
my $arg = ref($_[0]) ? shift(@_) : {};
my %prereq = @_;
confess "too late to register a prereq" if $self->is_finalized;
my $phase = $arg->{phase} || 'runtime';
my $type = $arg->{type} || 'requires';
aoeu git-fail (master) $ perl add-fail.t git /home/avar/g/git/git
1..3
# Testing git version git version 1.6.3.3
ok 1 - ./file is ignored
ok 2 - ./dir/file is ignored
ok 3 - ./dir/dir/dir/file is ignored
aoeu git-fail (master) $ perl add-fail.t /home/avar/g/git/git
1..3
# Testing git version git version 1.7.0.2.157.gb7e7f
ok 1 - ./file is ignored
#!/usr/bin/env perl
use 5.010;
use autodie;
use strict;
use File::Slurp qw[ slurp ];
#BEGIN { *Pod::Simple::DEBUG = sub () { 9001 } }
use Pod::Text;
use File::Temp qw< tempdir tempfile >;
use IO::Handle;
use Test::More 'no_plan';
aoeu ~ (master) $ echo "téśt case" | nopaste -s Shadowcat
http://paste.scsys.co.uk/40625
aoeu ~ (master) $ echo "téśt case" | nopaste -s Pastie
There is no form numbered 2 at /usr/local/share/perl/5.10.0/App/Nopaste/Service/Pastie.pm line 13
http://pastie.org/865807
aoeu ~ (master) $ echo "téśt case" | nopaste -s Gist
http://gist.github.com/329810
Since this module is a low level interface that directly exposes the
internal C<SvTAINTED*> functions it also presents new and exciting
ways for shooting yourself in the foot.
Tainting in Perl was always meant to be used for potentially hostile
external data passed to the program. Perl is passed a soup of strings
from the outside; it never receives any complex datatypes directly.
For instance, you might get tainted hash keys in C<%ENV> or tainted
strings from C<*STDIN>, but you'll never get a tainted Hash reference
aoeu tmp (7.3M) $ sqlite3 dbix.sql
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE next_token (
...> id INTEGER PRIMARY KEY NOT NULL,
...> expr_id INTEGER NOT NULL,
...> token_id INTEGER NOT NULL,
...> count INTEGER NOT NULL
...> );
s/iter DBIx::Class Hailo + DBI
DBIx::Class 136 -- -86%
Hailo + DBI 19.4 601% --
Top 15 Subroutines — ordered by exclusive time
Calls P F Exclusive
Time Inclusive
Time Subroutine
17616 20 3 297ms 297ms DBI::st::execute (xsub)
2953 1 1 239ms 499ms DBD::_::st::fetchall_hashref
503 1 1 203ms 1.28s Hailo::Storage::DBD::make_reply
2953 2 1 145ms 736ms Hailo::Storage::DBD::_pos_token
2781 2 1 100ms 112ms Test::Builder::_try
503 1 1 100ms 214ms Hailo::Tokenizer::Words::make_output
Top 15 Subroutines — ordered by exclusive time
Calls P F Exclusive
Time Inclusive
Time Subroutine
232888 14 14 4.84s 6.08s Class::Accessor::Grouped::get_inherited
1144733 27 27 4.81s 4.81s Class::Accessor::Grouped::get_simple
118512 4 3 2.14s 11.1s DBIx::Class::ResultSourceHandle::resolve
26548 4 1 1.96s 4.98s DBIx::Class::ResultSet::_resolved_attrs
189836 5 1 1.88s 2.65s DBIx::Class::ResultSource::_columns
134984 3 2 1.73s 6.34s DBIx::Class::Schema::source
use Dist::Zilla::Magic;
conf name => 'Hailo';
conf author => 'Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>';
conf author => 'Ævar Arnfjörð Bjarmason <avar@cpan.org>';
conf copyright_holder => 'Hinrik Örn Sigurðsson and Ævar Arnfjörð Bjarmason';
conf license => 'Perl_5';
conf_plugin '@AVAR' => {
dist => 'Hailo',