The use bytes is basically setting $^H at compile time.
According to that documentation, you should be able to do:
BEGIN { require bytes; bytes->import if $condition }
inside the block where you want the use bytes to be conditionally set. Of course, if you don't put it in a block, the file in which the source sits, will be your scope.
This seems the right thing according to the docs and seems to work with stricture:
$foo = $a;
BEGIN { require strict; strict->import if 1 }
$foo = $a;
__END__
Variable "$foo" is not imported at x line 3.
Global symbol "$foo" requires explicit package name at x line 3.
x had compilation errors.
If the import is not done, this runs without any errors:
$foo = $a;
BEGIN { require strict; strict->import if 0 }
$foo = $a;
__END__
Hope this made sense and helps.
Liz |