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

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

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
    [Corion]: Hi holli ;)
    [Corion]: In a way, it's sad that Firefox kills off the add-on functionality... But, as n-gate usually writes, "Firefox tries to be more like Chrome"
    [holli]: it's not always possible to do a complete rewrite without cutting off some pigtails
    [Discipulus]: indeed! new firefox seems poorer: many tab crash, and you open this link in FF?
    [Discipulus]: problem scrolling even main page..;=(
    [LanX]: holli -> Good Intentions: Wikisyntax for the Monastery

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (12)
    As of 2017-11-20 19:05 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (291 votes). Check out past polls.