The problem is that cpan will still be using whatever version of perl that you installed it with. You can check which version it's trying to install modules for by calling cpan --version.
You'll get a message like:
$ cpan --version
/usr/bin/cpan version 1.61 calling Getopt::Std::getopts (version 1.07
running under Perl version 5.18.2.
[Now continuing due to backward compatibility and excessive paranoia
See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION
To make sure that you're calling the CPAN shell with a specific version, you should call it using the specific version of perl, rather than the 'cpan' script: /path/to/perl -MCPAN -e shell.
Also note that you can run into the same problem with cpanm.