in reply to getting last_insert_id
DBI has a method called last_insert_id, but you're using DBIx::Class. Take a look at the insert method in DBIx::Class::PK::Auto - it may do the trick.