Hi,

I'm getting this error:
DBIx::Class::ResultSet::create(): create needs a hashref at insert.t line 22

from the script below.  I believe I am passing a hashref. I suspect
there is a problem with my Perl (5.10.0) but I might also be making a
newbie error.

Thanx,
Dp.


=============== script ===========
#!/bin/perl

use strict;
use warnings;
#use Crap;          # Why isn't there a crap in my distro?
use FindBin qw/$Bin/;
use Data::Dumper;

use lib "$Bin/../lib";
use SPL::Schema;

my $hashref = {
    number   => 'A100/0002',
    title          => 'A Title',
    codixId     => 651000002,
    };

my $schema = SPL::Schema->resultset('Assets');
             die "Can't connect $...@\n" unless $schema;
print Dumper($ref);
$schema->create->($ref) or warn "Error inserting: $...@\n";

======== 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/[email protected]

Reply via email to