Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
That 'writing perl modules for CPAN' book was a huge help! It cleared up a lot of questions I've had in the back of my mind.

As I spend more time looking around CPAN I'm finding more and more modules that are written with only perl. It seems like it was just my luck that the ones which initially caught my attention seemed to use a lot of C. I'm even finding pure perl alternitives for some of them or modules like Geo::IP which seem to include both.

It may be worth mentioning that I have nothing against non-Perl code in general. I even messed around a bit in C (12+ years ago). I was just not expecting to find it on CPAN. I had hoped that I could see how other folks were using perl to do the same sort of things I've been doing with it. When I saw all the non-perl going on I was starting to wonder if that would be possible. No more worries there!

A lot of people seem to run into trouble installing modules, and so I also had concerns about how easy/difficult it would be for others to install a script if it needed modules from CPAN. I'm less worried about that now that I know about PAR and have a better understand of how CPAN modules work in general.

I'm guessing that your modules may not have separate package names and just import all of their subs into the main program when used. They don't have Makefile.PL installers like CPAN modules do. And they don't track dependencies between themselves.

That is exactly the case. Like I said, before now I haven't really paid much attention to the whole module side of perl. The fact that my modules are so different from anything I saw on CPAN was starting to make me think I'd missed something important.

In some cases just doing what works for me would be enough, but I've been able to get something working only to find out later that it was put together in some abhorrently wrong manner that wouldn't work for anyone else, shouldn't even be working for me or doesn't work anywhere near as well as it would if I'd only done it correctly.

I may not ever write something that's used by more than 2 or 3 people, but anytime I do write something I try to imagine how it might look to someone else if they had to go in to fix/update/build on whatever I've done. Now that I want to start doing more with perl I figured it was worth checking with folks who know better.

Now that I feel much more enlightened I think I'll be safe if I stick to what I've been doing. Hell, after checking out the book and that video, I can see myself adding a module (or at least a script or two) to CPAN at some point in the future.

Thank you all!


In reply to Re: Have I misunderstood the point of modules or just CPAN? by RAS230
in thread Have I misunderstood the point of modules or just CPAN? by RAS230

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 browsing the Monastery: (4)
As of 2024-04-19 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found