in reply to use locale/utf8 scoping
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use locale/utf8 scoping
by mirod (Canon) on Aug 07, 2002 at 11:13 UTC |