According to that documentation, you should be able to do:
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.BEGIN { require bytes; bytes->import if $condition }
This seems the right thing according to the docs and seems to work with stricture:
If the import is not done, this runs without any errors:$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.
$foo = $a; BEGIN { require strict; strict->import if 0 } $foo = $a; __END__
Hope this made sense and helps.
Liz
In reply to Re: if only blocks were avoidable...
by liz
in thread if only blocks were avoidable...
by yosefm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |