This is an odd error message, since GD::Font is in fact almost certainly already installed on your system.
From the GD documentation:
GD defines the following four classes:
-
GD::Image
-
An image class, which holds the image data and accepts graphic primitive method calls.
-
GD::Font
-
A font class, which holds static font information and used for text rendering.
-
GD::Polygon
-
A simple polygon object, used for storing lists of vertices prior to rendering a polygon into an image.
-
GD::Simple
-
A "simple" class that simplifies the GD::Image API and then adds a set of object-oriented drawing methods using turtle graphics, simplified font handling, ability to work in polar coordinates, HSV color spaces, and human-readable color names like "lightblue". Please see GD::Simple for a description of these methods.
This implies that either GD is not being loaded correctly (or not in time), or you have a severely broken and/or ancient installation of it. Since the first of those is much easier to correct than the second, you should probably try fixing it first: simply add use GD; to the beginning of your program, and see if your troubles continue (or change to the unpleasant Can't locate GD.pm in @INC). If they do, consider upgrading your GD install.
If God had meant us to fly, he would *never* have given us the railroads.
--Michael Flanders