in reply to cpan install gd.pm ques

mkdir /Users/xyz/.cpan/sources/authors/id/L/LD: Permission denied

This means that you don't have the appropriate permissions to create the directory named above. Consult with your system administrator for how to solve this problem.

Do note that it is quite inadvisable to install modules into the system-supplied Perl, because the system perl belongs to the OS vendor, and they will change and install modules that they need to keep the OS working. Breaking a module in the system Perl can disrupt important system utilities that rely on particular versions of modules and Perl being available.

Consider using local::lib and/or perlbrew to maintain a separate installation.