use GD;
use strict;
use warnings;

my $bild = new GD::Image(100,100);
my $gray = $bild->colorAllocate(200,200,200);
my $blau = $bild->colorAllocate(0,0,255);
my $rot = $bild->colorAllocate(255,0,0);
my $gruen = $bild->colorAllocate(0,255,0);
my $gelb = $bild->colorAllocate(255,255,0);

my $poly = new GD::Polygon;
$poly ->addPt(80,80);
$poly ->addPt(20,70);
$poly ->addPt(30,50);
$poly ->addPt(40,15);
$poly ->addPt(50,60);
$poly ->addPt(15,20);
$bild->polygon($poly,$rot);

open(OUT, ">", "poly.gif");
binmode OUT;   # nur bei Windows noetig
print OUT $bild->gif;
close OUT;