Thanks! Missed that part...I updated my post with another example of code for this job. The OP's statement:
seemed at first glance to imply something something different than a cgi application that dynamically creates graphs. So as the devil's advocate, this may still very well be a case where update data locally, generate cool image locally and use Perl to automagically upload cool image to website may still be a good way to go.