in reply to Perl and SNMP

What I do fairly often is run a separate script/program that updates some statistics file.
When an SNMP subagent needs its data it just has to read that file for the latest statistics. To minimize the chance of a race condition (trying to read the file while its only half full or some similar misshap) i would recommend writing to a different filename and then doing a quick rename when everything is ready.