I don't think that this is possible. I tried to set $^H and to use pragma->unimport() at run-time but these approaches didn't (and probably shouldn't) work.
If you can set some of the logical variables at compile time you could possibly do something like this (using strict instead of utf8 as an example):
#!/usr/bin/perl -l my $foo; BEGIN {$foo = rand 2 > 1} BEGIN {require strict; strict->import('vars') if $foo} $not_scoped = 1; # Error if $foo is true BEGIN {strict->unimport('vars')} $not_scoped = 1; # Not an error print "Finished." __END__
--
John.
In reply to Re: use locale/utf8 scoping
by jmcnamara
in thread use locale/utf8 scoping
by mirod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |