#!/usr/bin/perl use GD::OrgChart; use constant FONT => "/usr/openwin/lib/locale/KOI8-R/X11/fonts/TrueType/TimesBold.ttf"; #use IO::Pipe; our $COMPANY; # put data into $COMPANY such that it looks like: $COMPANY = { text => "Owner", subs => [ { text => "President", subs => [ { text => "Watcher" }, { text => "Sitter" }, ]}, { text => "Security", subs => [ { text => "Watcher" }, { text => "Watcher" }, ]}, ]}; our $chart = GD::OrgChart->new({ size => 12, font => FONT }); $chart->DrawTree($COMPANY); open (PIC, ">gd.gif") || die "Oops unable open file"; if (PIC){ print "FILE OPENED"; }else { print "Oops!"; } binmode PIC; our $image = $chart->Image; print PIC ($image->gif()); close(PIC);