Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: conditional enable use bytes for a whole module at compiletime?

by ikegami (Patriarch)
on Nov 19, 2004 at 15:50 UTC ( [id://409020]=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://409020]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-26 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found