perl module installation problems... experts advice needed,...

----------
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
----------in win 2000 advanced server,..

i am somewhat comfortable with perl but i am new to perl modules..

when i tried to install xml::simple and xml::parser
there was an error.
----------
what my friend did is :
he created a directory xml inside the lib directoy and he simply copied simple.pm and parser.pm in the xml directory.. and that worked in my machine..
-----------
what i feel is:
"there may be some standard procedures one should follow while installing modules and etc.. even though if we do like copying it might work..but after sometime it may give some problems.."
------------
now i like to know the best practices one should follow while instaling..

thanks in advance...

There are indeed "standard" procedures.

On Unix systems, downloading the tarball, run "perl Makefile.PL" and then "make", "make test", "make install" (mostly as root)is the standard procedure. If there is errors, that usually implies some problems. For instance, for modules that have native (C) parts, that may mean missing 3rd party libraries, incompatibility or if the failure is with the tests, then assuming the tests are well maintained, it is likely to indicate the module may not work on your machine.

You can also use the CPAN module and the "cpan" shell to install modules. Pretty much an automation of the download, extract, compile and install phase. But as it is just using the same tarball, if you have problems with the manual installation you are likely to come into the same kind of problems with this. But most of the time, it is simple and reliable.

A past member has kindly written an introduction here:

Windows ActiveState distribution has packaged modules similar to that of CPAN, but not as complete. Use the "ppm" for the interface. If provided, any native components are already compiled so you don't need the compiler (MS VC++ Compiler). If this fails, for non-compiled module you can then copy files as your friend did (it is correct, and I do this too to put custom modules together with my project sources in order to avoid relying on systemwide offerings. But if there are compiled parts, then this trick won't work.Either you need an MS VC++ compiler (because ActiveState Perl is compiled with this compiler), or download mingw and compile Perl from sources with it, and then any custom modules you download.

So in my opinion, Windows is not a good environment for Perl development as there are too many compiled Perl modules nowadays.

What is the error? And how did you install it?

If you understand how the Perl require mechanism, then you should be pretty comfortable with this. As I said, I seldom install custom modules systemwide (except for compiled ones) to avoid transferring the sources to another machine just to find that the dependencies aren't installed. So simpler modules, it is better to put them locally rather than systemwide, and then set the @INC or 'use lib' to point to where the modules are. Most sophisticated Perl scripts do this. So it's normal.

i just refered the link:
http://www.cpan.org/modules/INSTALL.html

but instead of using this..
"If you're running Windows 95 or NT with the ActiveState port of Perl, "

we used:
"If you're running Windows 95 or NT with the core Windows distribution of Perl, "

---i think this may be the error.

in cmd prompt,

as in
"If you're running Windows 95 or NT with the core Windows distribution of Perl, "

------------------
C. BUILD

Go into the newly-created directory and type:

perl Makefile.PL
dmake
dmake test
-----------------

perl makefile.pl was fine... after that only we got error.

i did ppm in the cmd prompt and in ppm shell

PPM> version
2.2.0
PPM> query
---------
---------
XML-Parser [2.27 ] A Perl module for parsing XML documents
XML-Simple [2.09 ] Easy API to read/write XML (esp config files)
---------

but i downloaded only simple version 2.14
from:

what happened??... ie how xml-simple[2.09] came in the ppm??

As you can use the "ppm" command, I guess you are actually running the ActiveState Perl already, not a self-compiled perl for Windows.

As I said, unless you have MS VC++ compiler (which most of us here haven't), you need to rely on the ActiveState packages if available, as some modules may need a C compiler to compile. If you don't, it is normal for you to experience errors.

The ActiveState PPM package may be a little bit out of date compared with the CPAN ones, so the fact that they have different versions may be normal too.

You can just type

install <module_name>

in the PPM shell to install a module. An "upgrade" command is also available.