Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.

  1. Set up a work area.
    $ cd /some/base/work/dir $ mkdir DateTime $ cd DateTime
  2. 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
  3. Read any relevant documentation.
    $ view README # That's "README.md" for this distro $ view INSTALL
  4. Modify the module code.
    $ cd lib $ vi DateTime.pm
  5. Write new test(s).
    $ cd ../t $ vi new_test.t
  6. Create Makefile, build and test.
    $ cd .. $ perl Makefile.PL $ make $ make test
  7. 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".

— Ken


In reply to Re: How do I write a new sub in a git cloned CPAN module and test it by bypassing the Original Module by kcott
in thread How do I write a new sub in a git cloned CPAN module and test it bypassing the Original Module by yysachinyy

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



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 14:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found