Skip to content

Instantly share code, notes, and snippets.

Avatar

Graham Knop haarg

  • Amsterdam, Netherlands
View GitHub Profile
View gist:579302
diff --git a/lib/WGDev/Command/Ls.pm b/lib/WGDev/Command/Ls.pm
index 589939f..bdd3f7e 100644
--- a/lib/WGDev/Command/Ls.pm
+++ b/lib/WGDev/Command/Ls.pm
@@ -7,6 +7,8 @@ use 5.008008;
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
+use Try::Tiny;
+
View gist:1530621
package Plack::Middleware::MultiSession;
use strict;
use warnings;
our $VERSION = '0.001';
use Plack::Util;
use Plack::Util::Accessor qw(
name
View gist:5444976
MooseX::Aliases - MooX::Aliases
MooseX::ClassAttribute - MooX::ClassAttribute
MooseX::Configuration
MooseX::MarkAsMethods - not needed (don't use namespace::autoclean)
MooseX::NonMoose - Built in to Moo
MooseX::SetOnce - http://github.com/haarg/MooX-SetOnce
MooseX::StrictConstructor - MooX::StrictConstructor
MooseX::Types - MooX::Types::MooseLike or Type::Tiny
MooseX::Types::Moose - MooX::Types::MooseLike::Base or Types::Standard
View metacpan-api.txt
MetaCPAN::API
->new(base_url, user_agent)
->author(author_id) # returns a ::Author object
->author_search({ query }) # returns a ::ResultSet object
# additional methods for objects
# additional methods for backcompat
MetaCPAN::API::Author
->name
View lvalue-array.pl
use strict;
use warnings;
{
package LvalueArray;
use base 'Tie::Array';
sub TIEARRAY {
my ($class, $sub, $params, $afters) = @_;
my $self = bless [ $sub, $params, $afters ], $class;
}
@haarg
haarg / perl-todo.md
Last active Aug 5, 2022
Perl to-do list
View perl-todo.md
  • Moo
    • c3 new chaining
    • c3 attributes
    • isa change handling
    • refs in hints
    • inhale Moose parent (RT#105710)
    • _constructor_maker_for without install_delayed
  • Package::Stash
    • package name restrictions
  • CPAN::Changes
View nopaste
diff --git i/lib/MRO/Compat.pm w/lib/MRO/Compat.pm
index be0fc80..d4c0968 100644
--- i/lib/MRO/Compat.pm
+++ w/lib/MRO/Compat.pm
@@ -360,12 +360,19 @@ =head2 mro::get_pkg_gen($classname)
=cut
{
- my $__pkg_gen = 2;
- sub __get_pkg_gen_pp {
View recurse-c3-taint.pl
use strict;
use warnings;
use mro ();
BEGIN {
package Super;
use mro 'c3';
sub foo {
$_[0]->maybe::next::method;
}
View Needs.pm
package Test::Needs;
use strict;
use warnings;
our $VERSION = '0.002002';
$VERSION =~ tr/_//d;
BEGIN {
*_WORK_AROUND_HINT_LEAKAGE
= "$]" < 5.011 && !("$]" >= 5.009004 && "$]" < 5.010001)
? sub(){1} : sub(){0};
View keybase.md

Keybase proof

I hereby claim:

  • I am haarg on github.
  • I am haarg (https://keybase.io/haarg) on keybase.
  • I have a public key whose fingerprint is D35F 2849 914B 9653 2894 A881 1211 A7DB B2CE CB93

To claim this, I am signing this object: