Bloodnok has asked for the wisdom of the Perl Monks concerning the following question:
where <op> is one of either '==' or '@{}' and pkg::sub is an existant fully qualified sub, it seems that, whenever I run the test harness (using Test::More), the following error ensues ...use overload <op> => \&pkg::sub;
The only way to avoid it [this error], that I've discovered thus far, is to overload the stringify operator '""' for the package.Operation """": no method found, argument in overloaded package
Question is, since overload makes no mention of this [feature] that I can discern, has any one else encountered this problem... and if so, how was the problem resolved ??
Update:
As well as actually overloading the stringify operator, changing :
to read :use overload <op> => \&pkg::sub;
appears to provide a fix of sorts...use overload <op> => \&pkg::sub, fallback => 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: overload op requires stringify overload ??
by lostjimmy (Chaplain) on Feb 17, 2009 at 19:18 UTC |