Some common routines for writing collectd perl plugins