Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I don't recall this caller-based technique to enforce privacy as being used much,

My personal opinion is that most people don't feel they "need" it. This is back to the question of "culture" vs "control". In my inside-out objects talk, I use the analogy of double-yellow lines on the road versus concrete lane barriers. (Apologies to non-US drivers -- I hope the analogy is still clear.)

  • Double-yellow line analogy: You really shouldn't drive in the wrong lane against the flow of traffic because you might get yourself or someone else killed. Of course, there's nothing to stop you except the law, which will prosecute you after the fact if you're caught and can't explain yourself well.

  • Concrete lane barrier analogy: Even if you had a really, really good reason to drive in the wrong lane, you can't. In fact, if traffic is backed up and you have an emergency in the car, you can't even make an illegal U-turn to go the other way to get back the way you came.

My point is that Perl isn't really about the second way of doing things. And I suspect that many (most?) Perl programmers are sufficiently happy with the first that at most a simple caller() check is all they deem worthwhile. Anyone who really wants around it is going to find a way and there are diminishing (or even negative) returns in the time required to even try to stop them.

Just for fun, if you really want to bend your brain in the "subterfuge race", don't forget about overriding CORE::GLOBAL::caller() or the "# line 43" trick. (See the very end of perlsyn for the last one.) Even for "private" lexical subs, I bet one could get at them with PadWalker.


Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

In reply to Re: Perl Privvies by xdg
in thread Perl Privvies by tlm

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (3)
    As of 2021-03-03 02:27 GMT
    Find Nodes?
      Voting Booth?
      My favorite kind of desktop background is:

      Results (69 votes). Check out past polls.