From: Father Chrysostomos Date: Thu, 10 Feb 2011 22:35:57 +0000 (-0800) Subject: Relation between overloading and ties: second try X-Git-Tag: accepted/trunk/20130322.191538~5716 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfa5b3737e4f46c2d507630650f9d3e902d8f81d;p=platform%2Fupstream%2Fperl.git Relation between overloading and ties: second try The current text is confusing as it refers to tied values. Variables, not values, are tied (don’t bring up handles, please!). --- diff --git a/lib/overload.pm b/lib/overload.pm index c538177..3abde68 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -1522,7 +1522,8 @@ package C. Add methods sub FETCH { shift } sub nop { } # Around a bug -(the bug is described in L<"BUGS">). One can use this new interface as +(the bug, fixed in Perl 5.14, is described in L<"BUGS">). One can use this +new interface as tie $a, 'symbolic', 3; tie $b, 'symbolic', 4; @@ -1678,17 +1679,18 @@ from two overloaded packages. =item * -Relation between overloading and tie()ing is broken. Overloading is -triggered or not basing on the I class of tie()d value. +Before Perl 5.14, the relation between overloading and tie()ing was broken. +Overloading is triggered or not basing on the I class of the +tie()d variable. -This happens because the presence of overloading is checked too early, -before any tie()d access is attempted. If the FETCH()ed class of the -tie()d value does not change, a simple workaround is to access the value +This happened because the presence of overloading was checked +too early, before any tie()d access was attempted. If the +class of the value FETCH()ed from the tied variable does not +change, a simple workaround for code that is to run on older Perl +versions is to access the value (via C<() = $foo> or some such) immediately after tie()ing, so that after this call the I class coincides with the current one. -B a way to fix this without a speed penalty. - =item * Barewords are not covered by overloaded string constants.