Instantly share code, notes, and snippets.

View handles.pl
#!/usr/bin/env perl
package MyObject;
use Moo;
use Path::Tiny;
has file => (is => 'lazy', handles => [qw/slurp/]);
sub _build_file { path("./handles.pl") }
View perl testing synopsis.md

The Perl test ecosystem

How to write tests in Perl. An exploration of CPAN test libraries.

Topics

Prove

  • Test directory layout
  • Test::More
  • TAP
View create_missing_spice_tests.pl
#!/usr/bin/env perl
use strict;
use warnings;
use v5.19.6;
use Class::Load ':all';
use Path::Tiny;
use PPI;
use List::AllUtils qw/first_index/;
View create_missing_goodie_tests.pl
#!/usr/bin/env perl
use strict;
use warnings;
use v5.19.6;
use Class::Load ':all';
use Path::Tiny;
use PPI;
use List::AllUtils qw/first_index/;
View find_missing_tests.pl
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10.1;
use Clone qw/clone/;
use DDP;
use List::AllUtils qw/first_index/;
use PPI;
View git-spark
#!/usr/bin/env perl
# Inspired by @trisweb:
# http://github.com/holman/spark/wiki/Wicked-Cool-Usage
use strict;
use warnings;
use Getopt::Long::Descriptive;
use Encode qw/encode decode/;
use DateTime;
View id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAKAkFkdwGP5EzpIq8FV//xIyY0SKTreYedyw82VeVIkxVh5H7NcyV6Qqea5cbm/jqC0/ycK2aWriRPJCCrNC/i8XerMd66dF5/vWYzJhvEHS7y5lIMgeg7qag4o1H60LPpaGxgqoOuR0AYwgf2UofQXwSncwPZzQ5N1TRO7+awHDAAAAFQD9pvu3jVbWcdw1lIJT/z8DN/AndQAAAIAwTrepDGQSwVpC0GVqNiEleOAl4WY6oBToFeavnS0k7zGQcmRE4WgL67G3sCxW1pgueD8OrcdMa6T7PRQnIIl9srU6t8c6ZuedfP92g1Fo6EiYGACBdbtSMqcY4qwqt6hsF0E6nYj7MG0XcTrmG3aikoSarVq2bR5rkZzSOLl+RAAAAIBy1V0pMClbIkc/ayRdgPfMid76IZaH64tyNt3HeQ16+f7lwCmfhfkeP/hZyJ3HPctpZ0AWAR+u9dk3xzsBBbwnoeHR3X2qZvuTZIGPLe9Jy6y72rFYKcMOw72IHa+ViHVM5Ccd9alvrOy2u+T5K6ms/rGTjzEyI/2wePIyye7/9A==
View repl.pl
use lib 'lib';
use feature qw(say);
use Term::ANSIColor;
no warnings 'redefine';
my @plugins = (
'ReadLineHistory', # history saved across sessions
'Colors', # colorize return value and errors
'FancyPrompt', # provide an irb-like prompt