[Dbix-class] inserting more records

Octavian Rasnita orasnita at gmail.com
Wed Jan 10 14:50:55 GMT 2007


Hi,

Is it possible to insert more records using the same code and just adding a 
certain different field for each record?

I wanted to do something like:

my $rs = $schema->resultset("Table")->new({
# here some more fields defined
});

foreach my $user(@users) {
$rs->user($user);
}

$rs->insert;

This code inserts just the first record corresponding to the first element 
of @users.

Do I need to create a new $rs for each element of @users?

Thanks.

Octavian




More information about the Dbix-class mailing list