I don't have a shell access to my client's shared server, so I can't do it using perl/bash. Yes, I'll try this with PHP instead.
PHP can call system commands, so you could do system("Mysql import ...(file)...").
more info about the command here: http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html