To address the issue of
multiple queries, you can use an open database handle to prepare a query into a statement handle, and then execute it later. i.e.
# code that connects to your database here
my $first_query = $dbh->prepare('SELECT * FROM myTable');
my $second_query = $dbh->prepare('UPDATE myTable SET myField = ?');
$first_query->execute();
$second_query->bind_param(1, 'some string');
$second_query->execute();
# etc.
If you want some more specific help than that, please give us some code to look at. If you need more general help about how to use the DBI, you might want to try
here or
here.