Who can provide a script for calculating the total number of hydrogen bonds distributed along the Z-axis after molecular dynamics simulation

Hi,

   I used MS's Forcite for molecular dynamics simulation, and now I want to count the total number of hydrogen bonds of water molecules in the z-axis direction and the number of hydrogen bonds when oxygen atoms face downwards and upwards. Can someone help me provide a Perl script. Thank you very much !!!