in reply to cpan install gd.pm ques

CPAN was not correctly configured yet, see section Config Variables in CPAN. Modify make_install_make_command and mbuild_install_build_command to include sudo.

I see you are on OS X. I urge you to leave the system Perl installation alone and install your own extra Perl with perlbrew (http://perlbrew.pl). The result is self-contained in your home directory, you do not need any root permission.