Arduino + pulses

Hello , I am new to energy monitoring and hope someone can help me with my little project. I recently bought an Arduino uno equipped with an Ethernet shield (official) and looked at the following project: http://openenergymonitor.org/emon/node/48 My objective is to monitor my gaz meter through a CNY70 opto sensor. I would like on 24h to monitor the pulses ( just on digital entry) generated by the sensor and feed my database (mysql) creted in the previous URL. What would be the modification of the Arduino file to include the pulse counting and transfer to the database through the perl script? Thanks a lot