my $table_name = 'Table'; $sth = $dbh->prepare("INSERT INTO $table_name (ip,bsid,firmware) VALUES (?, ?, ?)"); $sth->execute($ip,$bsid,$firmware);