Your example does show that the effect of "use lib::lexical" is actually, just like local, dynamic instead of lexical. I wouldn't say "global" as the @INC is indeed is restored at the end of the scope. The secondary effect (or tertiary and so on) can be global and/or irreversible but this is brought upon by other action (do/require/use) and not by "use lib::lexical" or the change to @INC itself. And that can be said about any lexical pragma.
I did originally imagine lib::lexical mainly as a syntax sugar for 'local @INC = (..., @INC)'.
In reply to Re^2: A lexical lib pragma?
by perlancar
in thread A lexical lib pragma?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |