You probably want something like:
The reason that what you had didn't work is that the use happens are compile time before the code is executed.if ($species eq "H") { require human; human->import(); } elsif ($species eq "M") { use mouse; mouse->import(); }
You might want to consider using proper cased names for your modules as all lowercase names are conventionally reserved for pragmatic modules such as strict
/J\
In reply to Re: use module question.
by gellyfish
in thread use module question.
by Miyah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |