Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I keep re-reading this. and I cannot, for the life of me, see what value you can derive from knowing that a module was required rather than used?

Despite your explanations elsewhere, I would suggest that is it dangerous, and even unethical(in the most minor, trivial sense of that term) for you to make that determination.

What the f*** is he prattling on about?I hear the time-sync'd chorus emote.

Well, think of it like the cold war. And the continuous escalation that was the primary result of it.

If you can determine some difference between the overall effect of my module by determining whether it was required or used, then maybe there is some action I can take within my module to make that same determination and so alter that effect. But then, if you can detect it, and I can alter it, maybe there is some mechanism that will allow me to alter it but not allow you to detect it.

Of course, it's inevitable, that if I start taking action dependant upon whether you can detect whether I was required or used, that you are going to look for a method of subverting my method of detection whether I was required or used.

But if my module renames perl5x.dll and substitutes itself in that namespace, then I can intercept your calls to pp_require() and, falsely, report failure to require, but the go on to install myself anyway.

Alternatively, I could override require so that it was always actioned at BEGIN time, and always called the module import routine with a default value of :all.

That may not work identically to use in all cases, but it would stop Ovid from telling the difference between use and require in 87.243789100000000000001% of cases. And hey, that got to be worth the effort :)


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.

In reply to Re: Was a module use'd or require'd? by BrowserUk
in thread Was a module use'd or require'd? by Ovid

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 musing on the Monastery: (6)
    As of 2014-09-18 22:08 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (125 votes), past polls