Ok, instead of the 2nd Perl script I described being run by cron once per minute, it should be a daemon itself.
It's not hard to code a daemon in Perl.
See
http://search.cpan.org/~ehood/Proc-Daemon-0.03/Daemon.pm
Then when each call ends, it sends a request via some fast method of interprocess communication to this daemon.
There are many Perl modules for IPC:
http://search.cpan.org/modlist/Networking_Devices_IPC/IPC
Then the daemon Perl script maintains a persistent MySQL database connection and logs the data.
Another alternative is to find out why it takes so long for your script to connect to MySQL itself. Is it slow because of DNS? Network? Authentication? Caching?
You've given no sample code about how you connect, and no description of the architecture of your system. So it's hard to offer more specific advice.
Regards,
Bill K.