#!/usr/bin/perl use GD; use strict; use warnings; my ($w, $h) = (50, 50); my $img = GD::Image->new($w, $h); my $white = $img->colorAllocate(255,255,255); my $black = $img->colorAllocate(0,0,0); # this line causes a premature exit with "success". #my $monaco = GD::Font->load('Generic.ttf');# or die "Can't load monaco!"; $img->rectangle(10,10,20,20,$black); $img->stringFT($black,"./Generic.ttf",12,0,10,10,'A'); open (IMG, ">$0.png"); print IMG $img->png; close IMG;