# insert into table if ( DBIx::Recordset->Insert ( { '!DataSource' => $dbh, '!Table' => "settings", %$settings } ) ) { # get the league id from the insert above my $stmt = "select ID from settings where ID = last_insert_id()"; my $sth = $dbh->prepare($stmt); $sth->execute(); # put it into the positions hash $positions->{'league_id'} = $sth->fetchrow_array(); if ( DBIx::Recordset->Insert ( { '!DataSource' => $dbh, '!Table' => "nba_position", %$positions } ) ) { return 0; }