in reply to Re^2: use has it's own scope?
in thread use has it's own scope?
FYI I wondered if B::Deparse could show this. The answer is yes, with level 5 of deparsing or higher, use statments will be translated into their equivalent BEGIN blocks:
I don't think the fact that the lexical has a scope even shorter than the BEGIN block changes anything though.perl -MO=Deparse,-x5 -e "use Set my $x = 12;" sub BEGIN { require Set; do { 'Set'->import(my $x = 12) }; } -e syntax OK
|
---|