Skip to content

Instantly share code, notes, and snippets.

View avar's full-sized avatar

Ævar Arnfjörð Bjarmason avar

View GitHub Profile
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
...> );
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
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
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',
2454 REP) status: is not entity
2454 REP) calling method on_directory_deletion
2454 pushdir /tmp/snerp-into
2454 GIT) already on branch branch-newfeatures
2454 RUN) git rm -r --ignore-unmatch -f -q -- phase3/images
2454 popdir /home/avar/g/snerp-vortex
2454 REP) doing: directory_copy branches/newfeatures/phase3/images
2454 REP) entity:
2454 REP) status: is not entity
2454 REP) calling method on_directory_copy
use strict;
use warnings;
use Test::More tests => 50;
use DBI;
use File::Temp qw<tempdir tempfile>;
# Dir to store our brains
my $dir = tempdir( "hailo-test-dbd-exists-XXXX", CLEANUP => 1, TMPDIR => 1 );
for (1 .. 50) {
$ perl -le '$0 = "onion"; system "ps h $$ ; ps hc $$"'
8661 pts/4 S+ 0:00 onion
8661 pts/4 S+ 0:00 perl
$ ./perl -le '$0 = "onion"; system "ps h $$ ; ps hc $$"'
8633 pts/4 S+ 0:00 onion
8633 pts/4 S+ 0:00 onion