in reply to Re: require at compile time?
in thread require at compile time?

The glob exists.

What makes you think that? exists contradicts that.

More likely, the guts were changed in a manner that either causes a reference (a defined value) to be passed to defined or causes %URI:: to be evaluated in scalar context (returning 0, a defined value).

Replies are listed 'Best First'.
Re^3: require at compile time?
by JadeNB (Chaplain) on Nov 07, 2008 at 15:05 UTC
    Regardless of the state of the guts, I guess that the question is: Why is the statement require URI;, which is executed after the print (and, more importantly, the defined test), changing the result of it? It must be that something in the mere compilation of require URI; is changing the execution of the rest of the program, right?

    I originally thought that it must be that the act of compilation creates the glob for future reference, but you say that this is not so. How do you use exists to test for the existence of a glob? (Is that what you're doing in Re^2: require at compile time? below?) According to the documentation, it can only be used on hash or array lookups, or subroutine names.

      As I recall, it has long been the case that 'require URI;' has had a subtle compile-time impact in trying to disambiguate certain ambiguous syntax. But I don't know if the behavior change that you noticed was more due to this DWIM hint being changed or the mis-use of defined being changed (I am unaware of changes to either but my guess is that one of those likely changed).

      - tye        

      I forgot the bit about how appending require URI; changes the result. I struck out my earlier statement. As you can see, require URI; does have a compile-time effect on the symbol table:
      >perl -le"print for grep /::$/, keys %::" ... Internals:: DB:: >perl -le"print for grep /::$/, keys %::; require URI;" ... Internals:: DB:: URI::
        Thanks—that's extremely clear. I still don't understand your remaining statement in Re^2: require at compile time?, that exists contradicts the statement “The glob exists”, though. (I don't disagree—I just don't understand it.)