Another approach to this issue:

Isn't Date::Calc in core? It should be available with your standard perl installation, regardless you use Linux or M$-Dog or something else.

If it is not there for any strange reasons consider this (after download in the unpacked src directory of Date::Calc):

perl Makefile.PL PREFIX=/path/to/your/lib

Say then:

 make && make test && make install

Then, in your app say:

use lib q(/path/to/your/lib); use Date::Calc;

And i can't see any security problems installing modules as root. How else should this be done in the default places?. E.g. on my Mac:

Karls-Mac-mini:~ karl$ perl -e 'print join(qq(\n), @INC);' /sw/lib/perl5 /sw/lib/perl5/darwin /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 # and many more...

And:

Karls-Mac-mini:~ karl$ ls -hlrt /Library/Perl/5.12 total 216 -r--r--r-- 1 root wheel 31K 26 Feb 2011 PPI.pm -rw-r--r-- 1 root wheel 33B 11 Okt 2011 AppendToPath -r--r--r-- 1 root wheel 543B 4 Apr 2012 oo.pm -r--r--r-- 1 root wheel 20K 18 Jun 13:32 Carp.pm -r--r--r-- 1 root wheel 8,9K 9 Sep 03:15 strictures.pm -r--r--r-- 1 root wheel 946B 11 Sep 20:24 ok.pm -r--r--r-- 1 root wheel 23K 23 Okt 17:27 Moo.pm drwxr-xr-x 3 root wheel 102B 27 Okt 13:46 B drwxr-xr-x 7 root wheel 238B 27 Okt 13:48 DateTime # and many more...

As you can see everything belongs to root:wheel but the rest can use it anyway. This is the default: Stuff belongs to root:wheel in that directories but is used under your UID if you call it.

A thing one might think about is: I don't want to mess up my default @INC. Then use PREFIX as described above.

BTW: Consider to take a look at Datetime. And trust toolic.

As always, i hope i didn't miss something.

Regards, Karl

P.S.: I did something wrong, s***t. If installing as root, make install as root , or root does it himself, sorry for that - sink before you type ;-)


In reply to Re: Simple perl question by karlgoethebier
in thread Simple perl question by nua7

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.