peterv6 has asked for the wisdom of the Perl Monks concerning the following question:

I'm very new to Perl, and I need your help. I want to install the DateTime packages into my Perl 5.10 installation in Ubuntu 9.10. I found a post elsewhere that said to use the following command: perl install-module.pl DateTime::Locale Unfortunately, there doesn't seem to be an install-module.pl script on my system. Can anyone help me out? The other thing is that the script I want to run has this code: use DateTime; #The best date and time handling, great for use DateTime::Format::Strptime; # working with log files. use DateTime::Locale::root; # Are the Format::Strptime and Locale::root parts of the overall DateTime package? Thanks....
  • Comment on Newbie needs help installing DateTime packages

Replies are listed 'Best First'.
Re: Newbie needs help installing DateTime packages
by Hue-Bond (Priest) on Apr 09, 2010 at 09:58 UTC

    In Ubuntu it's best to use the prepackaged version of the package (if you're using the system Perl, that is).

    $ sudo apt-get install libdatetime-perl

    --
     David Serrano
     (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).

Re: Newbie needs help installing DateTime packages
by marto (Cardinal) on Apr 09, 2010 at 10:01 UTC

    You may want to think twice about messing with the system Perl. Operating systems like Ubuntu use this Perl installation, it's often wise to install your own version of perl elsewhere to work with.

    That said, I think DateTime may be available in the standard Ubuntu repository, your package manager should be able to install it.

    You say you've tried to install the module, but it doesn't "seem" to work. Can you be more specific (see How do I post a question effectively?). Other installation options include the cpan command line tool. See Installing Modules from the tutorials section of this site.

      Operating systems like Ubuntu use this Perl installation, it's often wise to install your own version of perl elsewhere to work with.
      So, we go through all the trouble to have separate core, vendor and site_lib directories, but vendors like Ubuntu still manage to screw things up?

      Why does p5p even bother?

        So, we go through all the trouble to have separate core, vendor and site_lib directories, but vendors like Ubuntu still manage to screw things up?

        If you had read the comment, you would realize that it is not a matter of "screwing things up". Instead, it is an acknowledgement that the operating system uses perl for a lot of administrative work.

        In that vein, it is useful for the system perl environment to be relatively static (including expected versions) while the development environment can be more fluid.

        On my system (FC12), the "system" perl is v10.0.0. The "development" perl is v10.0.1. You will find that if you update perl via CPAN or CPANPLUS that some of the desired updates are actually dependent on v10.0.1. I do not want to compromise the system operation (or do exhaustive tests) simply to save ~250M by not having a separate, custom version of perl.

        Hope this helps.