in reply to Scope in use
I recall this behavior being mentioned in a thread here not too long ago, unfortunately I can't seem to find it at the moment. (Update: AM found it, thanks)
The use docs do say that it is "exactly equivalent" to BEGIN { require Module; Module->import( LIST ); }, which is pretty explicit. So taking that into account the behavior makes sense.
But from a user's standpoint, the implicit block is certainly surprising.
My first thoughts on this are that I'm not sure if it would be possible to get rid of the extra scope though... whether something happens at compile time or runtime can make a huge difference if it has side effects (not necessarily variable declarations, but the LIST can be arbitrarily complex).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Scope in use
by Anonymous Monk on Sep 04, 2017 at 13:17 UTC |