I have two tables, book and language ; book belongs_to language , having a language column that indicates what language it is in. The language table is just the language column.
I want to make $book->language and get the language string without selecting the language from the language table. Is there any way to do this?
I suspect this in the context of the return. Should I do some kind of overload, say:
use overload "language_string" => sub { my $self = shift; return $self->language; }, fallback => 1;
But in this case, of course, I still get the language.
source share