in reply to conditional enable use bytes for a whole module at compiletime?
There's a module named if which was written specifically to do what you want. It comes with Perl.
script.pl
use strict; use warnings; # Initialized in BEGIN so the use can see $VERSION. use vars qw( $VERSION ); BEGIN { $VERSION = 0.1; } #use if $VERSION < 1, 'bytes'; use if $VERSION < 1, 'Proof' => 'try1'; use if $VERSION > 1, 'Proof' => 'try2';
Proof.pm
package Proof; sub import { print('used at ', $_[1], $/); } 1;
|
|---|