One way I think is nice to learn about modules is to start with a truly toy example, that has nothing but (say) a "hello world" sub defined in it, and just build it up from there. "Learn by doing." Of course I don't recommend this as the sole method! I think that the Perl Cookbook (the ram) and Effective Perl Programming both have excellent text-based introductions to modules and OOP in Perl. code> #!/usr/bin/perl package MyModule; sub hello { print "Hello, world!\n"; } 1; # modules must return true value </code> And then just go on from there. Probably the first thing you'll want to do is to export the sub, so you don't have to get used to namespace shifting all the time. So peek at just about *any* existing module and see how they use Exporter to export variables and subs into the main package. HTH, arturo

In reply to Re: Module Recommendation by Anonymous Monk
in thread Module Recommendation by le

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.