Tuesday, March 27, 2012

Can't locate XML/Simple.pm @INC( @INC in Perl linux

Sometimes you Perl code starts acting weird. You get error as "Can't locate XML/Simple.pm @INC( @IN" . This basically occurs due to a very simple reason:
XML-Simple.pm file missing in Perl linux
For example you can see the snapshot of an error message that I got:

How to solve Can't locate XML/Simple.pm @INC( @INC problem in Perl Linux
How to resolve XML/Simple.pm or Install Simple.pm
simple method to install XML::Simple is as follows:

perl -MCPAN -e 'install "XML::Simple"'

There is yet another test that you may do before installing. This is to check if XML::Simple is installed. For this try:

perl -e 'use XML::Simple;'



There is yet another method that I personally like because of less complexity involved. And as I can see, this is even faster:

Code:
cpan install XML::Simple


I would like to convey to my readers here some bits over the CPAN. This is collected from Internet and following has no intellectual claims by me :)


CPAN is the world-wide archive of perl resources. It consists of about
300 sites that all replicate the same contents around the globe. Many
countries have at least one CPAN site already. The resources found on
CPAN are easily accessible with the CPAN.pm module. If you want to use
CPAN.pm, lots of things have to be configured. Fortunately, most of
them can be determined automatically. If you prefer the automatic
configuration, answer 'yes' below.

The same can be seen in following picture:

If you prefer to enter a dialog instead, you can answer 'no' to this
question and I'll let you configure in small steps one thing after the
other. (Note: you can revisit this dialog anytime later by typing 'o
conf init' at the cpan prompt.)



And doing this solves the problem!!

2 comments: