Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by broquaint (Abbot)
on Nov 19, 2004 at 15:49 UTC ( #409019=note: print w/ replies, xml ) Need Help??


in reply to conditional enable use bytes for a whole module at compiletime?

Since you simply want to conditionally include a lexically scoped module at compile-time it sounds like the if module will do the job. If adapted to your example code it looks to work just fine:

BEGIN { $Y::VERSION = 0.1 } { package X; use if ( $Y::VERSION < 1 ), "bytes"; sub l { return length shift } } no bytes; print X::l( chr 3456 ); __output__ 3
HTH

_________
broquaint


Comment on Re: conditional enable use bytes for a whole module at compiletime?
Download Code
Re^2: conditional enable use bytes for a whole module at compiletime?
by borisz (Canon) on Nov 19, 2004 at 16:03 UTC
    Thats what I searched for!. Thanks.
    Boris

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-07-26 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls