looks like good advice above on the xml/memory issues .. just a couple quick code comments:
- Instead of $db->do("begin"); the 'AutoCommit' DBI attribute is typically used:
my $db = DBI->connect($data_source, $username, $auth, { AutoCommit =>
+0 } );
- might as well placeholder the DELETE statement, too (and don't need to prepare):
$del = $db->do(delete from master where org = ?", {}, $we);
- You can use a slice of the hashref to make the bind variables easier to read/maintain:
$db2->execute(
$we,
$id,
@{ $response->{offer}->{$id} }{ qw/
city
state
zip
link
slots_available
description
/ },
);