That's a very strange concept to do for a database. But, if
your database has triggers, you could set up an insert trigger
that inserts new rows in a temporary table that you can query,
or, if your database supports calls to outside programs, call
an outside program.
However, MySQL, being a rather limited database, doesn't have
triggers.
Anyway, this isn't a Perl problem at all, is it?
Abigail