A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Sed example - removing lines

for file in `grep -r mysqld t|cut -d: -f1|uniq`; do sed -i -e '/use Test::mysqld/d; /Test::mysqld->new/N; /Test::mysqld->new/N; /Test::mysqld->new/N; /Test::mysqld->new/N; /Test::mysqld->new/N; /Test::mysqld->new/d; /traits/d' $file; done; find t -name '*-e' -delete


Result:

+++ t/foo.t
@@ -1,6 +1,5 @@
use Test::MockModule;
use Test::Most;
-use Test::mysqld;
@@ -21,15 +20,8 @@ END {
use Test::DBIx::Class {
schema_class => 'Foo::Bar::DB',
- traits => ['Testmysqld'],
};
-my $mysqld = Test::mysqld->new(
- my_cnf => {
- 'skip-networking' => '', # no TCP socket
- }
-) or plan skip_all => $Test::mysqld::errstr;
-
ok my $SCHEMA = Schema, "got schema";
view raw sed.diff hosted with ❤ by GitHub