Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
There would seem to be very little penalty in at least disallowing the package ::::::; syntax the same as package 123 is already disallowed,

Forgetting the cost for a moment; why disallow it?

'::' is a separator. Multiple separators with nothing between them imply null namespaces. We allow the null top-level namespace $:: to good effect; albeit that it implies 'main'. Isn't allowing a null namespace at all levels just a logical -- if obscure and unfriendly -- extension of that.

It is perfectly feasible to make the fuel filler mechanisms on cars so that it would be impossible to casually drop a lit match into the tank. We do not do that because whilst it does happen; the occurrence is so rare -- and always deliberate -- that the costs of doing so are disproportionate to the occurrence. Especially when the main source of the occurrence -- the deliberate arsonists, criminals and vandals -- can just as easily adopt some other mechanism to achieve their goals.

For me, it all comes back to the pragmatism that lies at the heart of Perl. If people want to break encapsulation by directly accessing the instance data in objects; Perl doesn't try to stop them. Sure I can use inside out objects; but then "they" can always modify the source code to achieve their goals anyway, so I've imposed the cost of (at least one) extra dereference on every user in order to prevent the occasional perpetrator, who - if their need is sufficient, can still do it any way. And let's face it. Once my module is in their codebase; it is their code. Who am I to place restrictions upon what they need or choose to do with it?

The greatest danger to Perl's continued popularity, and even existence, is the recent obsession to turn Perl away from its pragmatic origins into some theoretically Utopian perfection. Which is impossible, even if it were desirable. Which it isn't.

Expending cycles trying to trap this particular piece of obscurism, when there are so many other possibilities:

{ package _'_'_'_'_; sub hi{ say 'hello from ', __PACKAGE__ } };; _'_'_'_'_::hi;; hello from _::_::_::_::_

Just seems pointless.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


In reply to Re^3: Perl allows package names consisting entirely of colons by BrowserUk
in thread Perl allows package names consisting entirely of colons by tobyink

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (16)
    As of 2014-07-31 17:16 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (249 votes), past polls