I've been spending a lot more time programming in Ruby lately, but I have OO Perl (and
merlyn's 'perlboot' intro) to thank for having a hope in heck of doing OO anything. In Ruby or Perl, if my classes are specific to the application at hand, I would make that my namespace and then group functions or objects accordingly. Say my application was a tool for writing books, I'd make package names like BookMaster::TOC (for managing tables of contents), BookMaster::Chapter (for managing chapters), and BookMaster::DB (for interfacing with a DB).
Now, if I found that I had some general utility function that was important to me-- suppose I were making a linked list class to make it so I could store each paragraph in a chapter in a list that would be more efficient to insert and delete items from than a vanilla array, then I might look on CPAN and see if there is a fitting namespace, like List::* and then call my class List::Linked.
And just to soothe your naming concerns, there is a whole big section on naming variables and stuff in "Code Complete". So you're not the first person to take it seriously. :)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.