Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I saw a thread recently about inside-out objects, and started thinking about the different ways to do OOP in Perl. At the moment, I generally just bless a hash and access its members (e.g. $self->{member}). As Abigail-II pointed out, though, this can make misspellings into tricky runtime errors. Also, the syntax seems kind of ugly to me.

So I was wondering what OO methodology the Perl Monks use. Some of the ones I'm familiar with are:

  • Straight hash-blessing
  • Inside-out objects
  • Class::Maker
  • use fields;
What kind of OO programming do you use and why?

I always thought it would be more realistic if the Matrix were attaching the humans to long poles and using them to beat their cake batter. Then Morpheus could say "to turn a human being into THIS" and hold up a big birthday cake. - slashdot

Edit by tye, ephasize "you" in title, close B and I tags


In reply to How do YOU do OO in Perl? by batkins

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 contemplating the Monastery: (6)
As of 2024-04-19 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found