Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Try this:
Basically, the first "print Dumper" fails and the second works fine. My guess is you are confused by this statement in the documentation for use: Because use takes effect at compile time, it doesn't respect the ordinary flow control of the code being compiled. In particular, putting a use inside the false branch of a conditional doesn't prevent it from being processed. The way I understand it is even if the "use" statements are processed at compile time, it doesn't mean the module functions become omnipresent. It will respect the order in which the statements are written: from top to bottom. In your case, the "use warn" is processed at compile time but when you do your first warn statement, the module's "warn" function is not available yet. Now, my question to you is, why does it mater? Is there something specific that you are trying to achieve and for that you need to "use" your module somewhere else, after you actually use its functions? Please enlighten us!
There are no stupid questions, but there are a lot of inquisitive idiots.
-- greengaroo
In reply to Re: Overriding CORE::GLOBAL::warn/die
by greengaroo
|
|