G'day yysachinyy,
Welcome to the Monastery.
"I tried setting PERL5LIB and use lib pragma ... but din't help."
[sic]
You don't show exactly what you did: here's some pointers.
-
PERL5LIB needs to be set before you call your scripts and made available to them (e.g. via export).
-
use lib should be used before use DateTime; be careful of relative paths.
-
Check that @INC has the path you set: consider doing so in a
CHECK or INIT block.
-
Are you running in "taint mode"?
See -T and -t in perlrun.
See perlsec and, in particular,
the "Taint mode and @INC" section.
-
Are you using the warnings pragma?
"I would like to know how Perl gurus/monks solve and contribute to CPAN Module."
My basic process would be as follows.
I'll reference the current DateTime module;
however, this would be what I'd generally use for any module.
You may have different methods for achieving each step —
I'm certainly not trying to recommend you use different tools —
but the order of steps should be much the same.
And, of course, the commands I've used are just examples.
-
Set up a work area.
$ cd /some/base/work/dir
$ mkdir DateTime
$ cd DateTime
-
Get the currrent distribution.
$ wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/DateTime-1.
+41.tar.gz
$ tar zxvf DateTime-1.41.tar.gz > DateTime-1.41.INSTALL 2>&1
$ view DateTime-1.41.INSTALL # Check there's no errors
$ cd DateTime-1.41
-
Read any relevant documentation.
$ view README # That's "README.md" for this distro
$ view INSTALL
-
Modify the module code.
$ cd lib
$ vi DateTime.pm
-
Write new test(s).
$ cd ../t
$ vi new_test.t
-
Create Makefile, build and test.
$ cd ..
$ perl Makefile.PL
$ make
$ make test
-
Repeat the last three steps until the code does what you want and the tests all pass.
$ make realclean
$ # ... repeat commands already shown ...
See also: "PAUSE: The [Perl programming] Authors Upload Server".
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|