Skip to content

Commit

Permalink
Class-Tiny-527c: no strict hashpairs
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed May 15, 2017
1 parent 0b709b1 commit 0205433
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions prefs/Class-Tiny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
comment: "cperl strict hashpairs"
match:
distribution: "Class-Tiny-1\.006"
perlconfig:
version: "^5\.2[78]"
usecperl: "define"
patches:
- "RURBAN/patches/Class-Tiny-527c.patch"
11 changes: 11 additions & 0 deletions sources/authors/id/R/RU/RURBAN/patches/Class-Tiny-527c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff -bu ./lib/Class/Tiny.pm~ ./lib/Class/Tiny.pm
--- ./lib/Class/Tiny.pm~ 2017-05-15 10:11:53.000000000 +0200
+++ ./lib/Class/Tiny.pm 2017-05-15 10:11:27.000000000 +0200
@@ -30,6 +30,7 @@
# adapted from Object::Tiny and Object::Tiny::RW
sub create_attributes {
my ( $class, $pkg, @spec ) = @_;
+ BEGIN { strict->unimport('hashpairs') if $] > 5.026 and $^V =~ /c$/; }
my %defaults = map { ref $_ eq 'HASH' ? %$_ : ( $_ => undef ) } @spec;
my @attr = grep {
defined and !ref and /^[^\W\d]\w*$/s

0 comments on commit 0205433

Please sign in to comment.