use strict; use warnings; use GraphViz; use CGI; my $q = new CGI(); print $q->header(), $q->start_html(); open my $dot, ">", "tree.dot" || die $!; print $dot qq(digraph g { graph [] A -> B; C -> B; }); close $dot; my $cmd = "dot -Tgif tree.dot -o tree.gif"; system($cmd); print $q->end_html;