Fix exception when $_ is modified in before/after.
authorStash <jeremy.stashewsky@socialtext.com>
Fri, 17 Jul 2009 01:10:03 +0000 (18:10 -0700)
committerStash <jeremy.stashewsky@socialtext.com>
Fri, 17 Jul 2009 01:10:03 +0000 (18:10 -0700)
commit342c0218f20cac0d4201e3d02eadc79d98bd3ac1
tree31cf19dc610137b4c26f7d8a593876cf938fe67f
parent7fe2c0b65ce511286856916fc8f245d2d3bc4f9c
Fix exception when $_ is modified in before/after.

I _think_ what's happening here is that $_ was getting aliased to an entry in
@$before/@$after, so that modifying $_ would in fact modify that array slot's
scalar.

Declaring `my $c` like this doesn't seem to impact performance vs. using $_.
Putting it outside the "cache" closure means `my` only gets run once.
lib/Class/MOP/Method/Wrapped.pm
t/313_before_after_dollar_under.t [new file with mode: 0644]