one approach is to create a service and bind it to archive events. each time an archive happens, your service is invoke. then all you have to do in the service is call out to your perl script. it would look something like this:
from weewx.engine import StdService
class UpdateRRD(StdService):
def __init__(self, engine, config_dict):
super(UpdateRRD, self).__init__(engine, config_dict)
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
def new_archive_record(self, event):
subprocess.call(["fancy-perl-program.pl"])
not sure how you get data to your perl script, but all of the fields are available in event.record
see "Customizing the weewx service engine" in the customization guide for more examples:
another approach would be to use python bindings to rrd to do the updates directly. i used to do that before i found influx and grafana...
m