So, what do you think the following code does?
package Bar; use overload '""' => sub { "Bar" };It's not
package main;
$a = $b = {}; bless $b, 'Bar'; print $a, "\n"; print $b, "\n";
Bar Barwhich is what I would expect.
Bar=HASH(...) BarWhich isn't exactly great. This is a problem on (at least) perl 5.8.0rc1, 5.6.1 and 5.6.0.
Re:stab in the dark
pdcawley on 2002-06-06T08:51:34
Yup. It's nothing to do with $a/$b. There's been a claim on p5p that it's working as designed. However, I think it's been accepted that it may well be broken as designed, but it's not going to get fixed for 5.8.
Which means ugly workaround time at castle pixie. Or something.