I'm new to Perl scripting language(beginner). What is the use of CPAN
module,why we need this module? please let me know.
How install in CPAN
in Linux(CentOS).
The CPAN
module is useful for installing other modules from the Comprehensive Perl Archive Network (CPAN). You can use it like this (e.g. to install Exporter::Tiny from the CPAN):
perl -MCPAN -e'install Exporter::Tiny'
Though there are other tools available for installing modules from the CPAN. (For example, cpanminus which I'd recommend over the CPAN
module.)
You probably don't need to install the CPAN
module - it comes bundled with Perl itself, so unless CentOS (or Redhat upon which CentOS is based) has taken effort to remove it from their standard Perl package (which would not be without precedent - Redhat have removed modules from the standard Perl package before - much to many people's annoyance), you probably already have it. You can check if you've already got it like this:
perl -MCPAN -le'print $CPAN::VERSION'
Also the use of the CPAN is very easy.In your prompt write cpan
and then install Date::Simple
to install the Date::Simple perl module or whichever module you need.
How install in CPAN in Linux(CentOS)
CPAN has been a part of the core Perl distribution since Perl 5.004 was released in 1997. It's very unlikely that you'll be using a version of Centos that doesn't already have it installed.