For Synology DSM or other systems running Entware package manager, Miguel's answer is correct, and the specific command to install CPAN is:
opkg install perlbase-cpan