||if only blocks were avoidable... was the reason for coming up with this (possible) abomination. Slightly adapted here, with some more checks in case the same module is used from different locations with different settings.
Basically, this is a framework for a module that will either be compiled with "use bytes" or not, depending on a parameter passed (indirectly) to the import routine. This turned out rather tricky to do.
So, in your program you would either do:
and the code of Foo.pm would be compiled with "use bytes" active. Alternately, if you would do:
use Foo qw(usebytes);
in your program, then the source of Foo.pm would be compiled without "use bytes".
I was wondering whether this could / should be made into a generally available module and/or whether this could be applicable to other pragma's. Until I've made my mind up, I'll be leaving it here as this snippet.