Hi,
$dbh = DBI->connect('dbi:mysql:dbname','user','passwd');
if($dbh->do("insert into <table-name> value('$data1','$data2 etc...)") ==
- {
blah blah } else { blah blah }
Is the DBI->connect line in your email exactly as you have it in the perl code? If so, then you need to replace dbname with the name of the database that you wish to work on (unless it is called dbname, in which case I am wrong). I think this may be causing the connect to fail and therefore the function $dbh->do will not work as $dbh doesn't contain a valid db handle (and all its associated functions).
Also the SQL statement needs 'value' to be replaced by 'values', but that is just me probably being a bit too pedantic on a typo that probably doesn't appear in the code.
Cheers,
Mat