In this version however you have to reuse the module, which can be problematic.use Foo; my ($foo) = grep {/Foo\.pm$/} values %INC; { # so that local can be local local @ARGV = $foo; local $/; eval "#line Foo.pm 1\nuse bytes;" . <>; } die $@ if $@; print Foo::len(); # prints 2
In reply to Re^4: impose 'use bytes' on another package
by codeacrobat
in thread impose 'use bytes' on another package
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |