summaryrefslogtreecommitdiff
path: root/lib/overload.pm
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-02-10 14:35:57 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-02-10 14:35:57 -0800
commitcfa5b3737e4f46c2d507630650f9d3e902d8f81d (patch)
treeb4b320ee743020eec02e46705b93f1a6ddc2114a /lib/overload.pm
parentdc04e1e9e5625cc5319a68130165b381dfd4c6fa (diff)
downloadperl-cfa5b3737e4f46c2d507630650f9d3e902d8f81d.tar.gz
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!).
Diffstat (limited to 'lib/overload.pm')
-rw-r--r--lib/overload.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/overload.pm b/lib/overload.pm
index c538177265..3abde68b78 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -1522,7 +1522,8 @@ package C<symbolic>. 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<previous> 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<previous> 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<previous> class
coincides with the current one.
-B<Needed:> a way to fix this without a speed penalty.
-
=item *
Barewords are not covered by overloaded string constants.