Ah, sorry I wasn't specific. Perl module files should be saved with a ".pm" extension, and they should be saved in the library path (really, in a library path, as there may be multiple... when you require or use a module, all the library paths in @INC are searched for that file).

Also, module-names map to file-names in the following manner: two colons ("::") are used to separate files from directories or directories from sub-directories (regardless of what is actually used for this purpose on your operating system: backslash for windows, slash for *nix, colon for mac classic, etc). So, require My::New::Library; is equivalent to require "$lib_path/My/New/Library.pm"; on *nix, or to require "$lib_path\\My\\New\\Library.pm"; on dos/windows, etc.

Again, though, I'm just parroting back documentation to you (not that I mind). You can see this stuff for yourself in perldoc perlmod. (I think before I mentioned perlmodlib, but I should have checked that first... I actually had it mixed up with perlmod, which is more useful info for what you're trying to get a handle on... sorry).

------------ :Wq Not an editor command: Wq

In reply to Re^5: Require or Do vs. more maintenance by etcshadow
in thread Require or Do vs. more maintenance by Stenyj

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.