0

I have a Macbook(pro 2012 model) with the latest OSX version (Yosemite). I realize perl is pre-installed on unix based systems. Now I'd like to install certain perl modules namely

  1. XML::simple
  2. XML::Parser
  3. ExtUtils::MakeMaker

I have downloaded them from here but I'm quite unsure if its for a Mac based file or not. So I'd request anyone if you can help me verify if its the right version for the Macbook and also with the step by step process to install them.

Any help is highly appreciated. Thanks!

PS: As I have a very low data connectivity in the residential area, I will not be able to go online and install, hence I have downloaded it from the office system (Linux based).

Divox
  • 101
  • 6
  • 4
    Don't install `XML::Simple`. It'll only lead to pain! [Why is XML::Simple discouraged](http://stackoverflow.com/questions/33267765/why-is-xmlsimple-discouraged) – Sobrique Dec 18 '15 at 10:56
  • 1
    I would suggest from your office based system - you should `cpan install`, because you may find it'll download some additional dependencies. Or retrieve pre-packaged modules from your installation CD, which may already be available. – Sobrique Dec 18 '15 at 10:58
  • @Sobrique from where I live, we don't get the installation CD, we have the OSX and its elements already preloaded :( – Divox Dec 18 '15 at 11:05
  • 1
    http://www.thegeekstuff.com/2008/09/how-to-install-perl-modules-manually-and-using-cpan-command/ – Quentin Dec 18 '15 at 11:05
  • 1
    Try this for offline install. http://stackoverflow.com/a/1874448/3005251 – bolav Dec 18 '15 at 11:17
  • 1
    Possible duplicate of [How do I install Perl modules on machines without an Internet connection?](http://stackoverflow.com/questions/1873329/how-do-i-install-perl-modules-on-machines-without-an-internet-connection) – bolav Dec 18 '15 at 11:17
  • @Quentin I have downloaded the cpan,xml::parser, xml::simple,extutil::makemaker from the link given. I will try to extract the cpan first and then install the perl modules. Hope I don't crash the system! – Divox Dec 18 '15 at 12:07
  • `cpan` is a module for downloading and installing modules, it is also part of code Perl. There isn't any point in upgrading it if you are installing modules manually. – Quentin Dec 18 '15 at 12:09
  • I would be very surprised if ExtUtils::MakeMaker wasn't already installed. It has been a part of the standard Perl installation for over twenty years. – Dave Cross Dec 18 '15 at 12:19
  • @DaveCross I may have to check on that on my computer. The only information I saw was "perl" and another which I couldn't remember right now! – Divox Dec 18 '15 at 12:31
  • @Quentin I will be installing them manually. – Divox Dec 18 '15 at 12:32
  • Sorry, that was my British understatement getting in the way of clear communication again :-) There's no need to check your computer. You already have ExtUtils::MakeMaker installed. – Dave Cross Dec 18 '15 at 12:33
  • Looks like I'm not quite bright either, if you know what I mean(the intended pun) ;) – Divox Dec 18 '15 at 12:40

1 Answers1

3

The module distributions on CPAN aren't specific to an individual platform. Some are Perl-only, in which case it doesn't matter what the platform is, and others use XS (C) sgements, which will be configured for you when you build the module

The installation process for a Perl module is described in perlmodinstall

Briefly, it goes like this

  • Decompress and unpack the module — tar -xzf Module.tar.gz

  • Prepare the makefileperl Makefile.pl

  • Build the module* — make

  • Test the module — make test

  • Install the module — make install

But there may be some variations on this. Always check the README file in the unpacked module if there is one

Borodin
  • 126,100
  • 9
  • 70
  • 144