[CDBI] Multiple inflate CODE references

William Ross will at spanner.org
Fri Oct 7 11:11:36 BST 2005


On 7 Oct 2005, at 10:52, Kevin White wrote:

> Hi Folks,
>
> I am new here so forgive me if this has come up before, I couldn't  
> find anything in the archives so I thought I would post and get  
> some thoughts. I have a table structure with the following has_a  
> relationships:
>
> __PACKAGE__->has_a( expire_date => 'Time::Piece',
>     inflate => sub { Time::Piece->strptime( shift, "%Y-%m-%d" ) },
>     deflate => 'ymd',
> );
>
> __PACKAGE__->has_a( start_date => 'Time::Piece',
>     inflate => sub { Time::Piece->strptime( shift, "%Y-%m-%d" ) },
>     deflate => 'ymd',
> );
>
> (Code is unashamedly ripped from the CDBI docs)
>
> Trouble was I kept getting the following:
>
> Can't store CODE items at /Library/Perl/5.8.6/Class/DBI.pm line  
> 1039, <IN> line 79.
>
> The line in questions is:
>
>     my %hash = %{ dclone($class->__meta_info || {}) };

It's a bug in 3.0.9. Tony knows about it and is uploading a fix round  
about now.
The only question is whether the discarded primary key fix is  
incorporated too, and the answer is 'probably not' because I've got  
too much to do this morning :(

best

will






More information about the ClassDBI mailing list