Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Scope in use

by haukex (Monsignor)
on Sep 04, 2017 at 09:00 UTC ( #1198652=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1198652]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-11-20 03:24 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (283 votes). Check out past polls.