[Dbix-class] Error in DBIx::Class::Manual::Cookbook

Toby Corkindale tjc at wintrmute.net
Fri Oct 13 13:29:22 CEST 2006


Seems to be an error in the Manual::Cookbook.
Under "Stringification" it says:
       Employ the standard stringification technique by using the "overload"
       module.  Replace "foo" with the column/method of your choice.

           use overload ’""’ => ’foo’, fallback => 1;

However, this results in an error of:
Can't resolve method "???" overloading """" in package "overload"

Changing the overload line to this (thanks Castaway!) works:
    use overload '""' => sub { return $_[0]->foo; }, fallback => 1;


This is on Perl 5.8.8 (overload.pm $VERSION=1.04).

-Toby

-- 
Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --keyserver www.co.uk.pgp.net --recv-key B1CCF88E)



More information about the Dbix-class mailing list