[Dbix-class] Should this work?

Matt Whipple matt at mattwhipple.com
Tue Sep 15 20:12:33 GMT 2009


> You want to pass the ref as an argument to create
>
> $schema->create($ref)
>
> The original code (with the second ->) would be trying to dereference 
> create and access something within it.
>
Whoops...change that to accessing something within the return value of 
create().

>> ======== output ========
>> $VAR1 = {
>>           'codixId' => 651000002,
>>           'title' => 'A Title',
>>           'splNumber' => 'A100/0002'
>>         };
>> create needs a hashref at
>> /usr/local/share/perl/5.10.0/DBIx/Class/Schema.pm line 1027
>>     DBIx::Class::Schema::throw_exception('SPL::Schema', 'create needs a
>> hashref') called at
>> /usr/local/share/perl/5.10.0/DBIx/Class/ResultSet.pm line 3090
>>     DBIx::Class::ResultSet::throw_exception('DBIx::Class::ResultSet=HASH(0x861a4e8)', 
>>
>> 'create needs a hashref') called at
>> /usr/local/share/perl/5.10.0/DBIx/Class/ResultSet.pm line 2298
>>     DBIx::Class::ResultSet::create('DBIx::Class::ResultSet=HASH(0x861a4e8)') 
>>
>> called at insert.t line 22
>>
>> _______________________________________________
>> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
>> IRC: irc.perl.org#dbix-class
>> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
>> Searchable Archive: 
>> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>>   
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: 
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk




More information about the DBIx-Class mailing list