2009/9/15 Matt Whipple <[email protected]>:
>
>> You want to pass the ref as an argument to create
>>
>> $schema->create($ref)
I've made some alterations (including the mega laughable typos) but
I'm still getting un-expected results:
Can't call method "select_single" on an undefined value at
/usr/local/share/perl/5.10.0/DBIx/Class/ResultSet.pm line 740.
==============
#!/bin/perl
use strict;
use warnings;
use Carp;
use FindBin qw/$Bin/;
use Data::Dumper;
use lib "$Bin/../lib";
use SPL::Schema;
my $ref = {
number => 'A100/0002',
title => 'A Title',
codixId => 651000002,
};
my $schema = SPL::Schema->resultset('Assets');
# my $schema = SPL::Schema->resultset('Assets')->search();
die "Can't connect $...@\n" unless $schema;
print Dumper($ref);
$schema->find_or_create($ref) or warn "Error inserting: $...@\n";
#$schema->create($ref) or warn "Error inserting: $...@\n"; prints Can't
call method "insert" on an undefined val
======================
Can anyone spot the error of my ways?
Thanx,
Dp.
_______________________________________________
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]