in reply to Re^3: impose 'use bytes' on another package
in thread impose 'use bytes' on another package
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: impose 'use bytes' on another package
by diotalevi (Canon) on Apr 06, 2006 at 14:37 UTC |