Is there a way to watch a mysql database for changes using perl?
问题 I'm looking for a solution similar to the inotify method of watching files for changes. I'm aware that I could watch the binlog file of the mysql database and run queries to pick out the new results but that seems very inefficient and inelegant; as does simply doing masses of queries in a loop waiting for new results. 回答1: If you add a TRIGGER to the table(s) you're interested in, you can use that to alert the watching application. You could do that in a number of ways: Create an audit table