Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Scope in use

by haukex (Abbot)
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: (4)
As of 2018-07-22 16:52 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (454 votes). Check out past polls.