Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
A bit OT, but I think you've given a simplified answer to a simplified question.

I'm not sure how AUTOLOAD breaks encapsulation, as the AUTOLOAD code can decide what is allowed and what isn't [die "Horribly" comes to mind]. And AUTOLOAD only needs to be called the first time an unregistered method is requested -- the symbol table hockey will avoid future AUTOLOAD calls on that method, at least.

But maybe you meant to just generate all of the sub refs at initialization, so all the methods didn't need explicit coding, just a method factory? Autogenerating all method code is probably faster than the AUTOLOAD runtime on just one method (for some values of all method code).

On further reflection, it sounds like we might be in violent agreement.

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^3: (~OT) How to measure Perl skills? by QM
in thread How to measure Perl skills? by optimist

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 taking refuge in the Monastery: (6)
As of 2024-04-25 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found