From: David Leadbeater Date: Tue, 11 Jan 2011 22:34:11 +0000 (+0000) Subject: Need to use around to fake class style inheritance in a role, yuck X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=235f639907b987b1071de49449145e6d312768ef;p=p5sagit%2FEval-WithLexicals.git Need to use around to fake class style inheritance in a role, yuck Note these commits need the changes I just pushed to Moo.git people/dg/compose to work. --- diff --git a/lib/Eval/WithLexicals/WithHintPersistence.pm b/lib/Eval/WithLexicals/WithHintPersistence.pm index 92d5e77..de3f76b 100644 --- a/lib/Eval/WithLexicals/WithHintPersistence.pm +++ b/lib/Eval/WithLexicals/WithHintPersistence.pm @@ -41,7 +41,8 @@ sub _capture_unroll_global { ); } -sub setup_code { +around setup_code => sub { + shift; # we bypass orig, i.e. using role as normal inheritance. my($self) = @_; # Only run the prelude on the first eval, hints will be set after # that.