Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I've been messing around with perl on and off for a few years now, but never for anything too serious, mostly automating basic sys admin type tasks. I thought modules were mostly for code reuse, and anytime I found myself wanting to add a subroutine to a script that I'd already written for an older script, I'd consider throwing it in a *.pm file.

Now I've got a small handful of *.pm files that each hold several subroutines related to a particular type of task and I use those all the time in my scripts.

If I want to share a handy script with someone else, all I have to do is send them the script and the .pm file(s) it needs or I could take a few seconds to copy the subroutines I need out of the .pm file, paste it into the script itself and modify a line or two so I that can send the whole thing in one file. I thought it was all pretty handy, until I saw CPAN. Now I think I'm doing it wrong.

Sure I'd heard about CPAN, and how it was this great place where people shared all their most useful perl code, but I wasn't really interested in it. I use perl scripts everyday but I don't write new ones all that often. I wanted more experience with the language before I started to mess around with other peoples code. A little bit of "re-inventing the wheel" is great when your learning right?

Recently I've been starting to use perl more and more often, and I've been poking around here, and thought I would finally take a look at some of the modules at CPAN as well to see what I could learn from them. Many of them do look interesting but none of the ones I saw look likely to help me learn perl. It looks like I'd learn more at CPAN as a C programmer. Even the perl scripts on CPAN require modules that were not written in perl.

Why am I compiling perl modules when I can't even compile the scripts that use them? Are all these modules written in other languages because they really cannot be done in perl alone? Where (besides here) is the site where people share useful perl code?

when I consider my own simple (although clearly misguided) setup for reusing and distributing perl, I have to wonder why real perl modules are considered to be such a good idea. I've never had to worry about ppm, dependencies, repositories, or make/compile errors before.

One of the things I love about perl is that I can replace my shell scripts and batch files and use one perl script for both systems. If I wrote a script using one of these modules how could I send it to my friend using windows? I'd have to include a huge set of directions (and probably include a link for nmake) and then hope it (and all it's dependencies) will be supported by the version of activeperl they run. In the past it was as easy as saying "unzip the .pl and .pm file into the same directory".

I really thought *the* website for perl code would be much less complicated.

If I've just got the whole concept of perl modules wrong, what should I be doing with my collection of subroutines?

I was pretty excited about using modules to start getting more out of perl, now I just feel disillusioned and even more unsure of myself.


In reply to 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 studying the Monastery: (6)
As of 2024-03-28 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found