I got this working now.
I printed $@ to display the error returned from stringFT(). It said this:
libgd was not built with FreeType font support
What I ended up doing was using ActivePerl 18.104.22.1686 (ActivePerl-22.214.171.1246-MSWin32-x86.msi). I downloaded it from oldapps.com. It did not have GD installed, so from the Windows command prompt I ran:
ppm install http://theoryx5.uwinnipeg.ca/ppms/GD.ppd
this installed GD Version 2.35
There are probably other websites to find GD.ppd, but I found instructions from here:
Now it works. I am not sure if this will work with the current latest version, 5.10, because 5.10 comes with GD. I don't know if you can simply replace the old one with a new one.