Home: Perl Programming Help: Advanced:
2 Address module via variable- is there a way?



pozvanete
Novice

Mar 7, 2009, 6:42 PM


Views: 4442
2 Address module via variable- is there a way?

$my_module = 'new_pm';

if($my_module eq 'new_pm'){ use $my_module ; }

Is it possible with eval or ..?


KevinR
Veteran


Mar 7, 2009, 7:16 PM


Views: 4440
Re: [pozvanete] 2 Address module via variable- is there a way?

With require it is:


Code
$my_module = 'new_pm';  

if($my_module eq 'new_pm'){require $my_module ; }


There is also the "if" pragma:

http://perldoc.perl.org/if.html
-------------------------------------------------