Y
Yohan N. Leder
Hello. Does it exists a method to "include" a module depending of a
scalar value ?
When I want to include one depending of a constant value (i.e. a value
which already exist at compile-time), I do something like :
BEGIN{if (FLAG){require Thing; import Thing qw(trick dummy);}}
But what if the constant FLAG becomes a variable $FLAG ? A code like
this same above (replacing FLAG with $FLAG) dives a ligitimate "use of
uninitialized value...", just because $FLAG is only initialized at
runtime)
Is there a way to achieve this : conditional "use" of a module based on
a variable value ?
scalar value ?
When I want to include one depending of a constant value (i.e. a value
which already exist at compile-time), I do something like :
BEGIN{if (FLAG){require Thing; import Thing qw(trick dummy);}}
But what if the constant FLAG becomes a variable $FLAG ? A code like
this same above (replacing FLAG with $FLAG) dives a ligitimate "use of
uninitialized value...", just because $FLAG is only initialized at
runtime)
Is there a way to achieve this : conditional "use" of a module based on
a variable value ?