title: How can I conditionally use a module in Perl?
body: <p>I want to do something like this in Perl:</p>
  
  <pre><code>$Module1="ReportHashFile1"; # ReportHashFile1.pm
  $Module2="ReportHashFile2"; # ReportHashFile2.pm
  
  if(Condition1)
  {
    use $Module1;
  }
  elsif(Condition2)
  {
    use $Module2;
  }
  </code></pre>
  
  <p>ReportHashFile*.pm contains a package ReportHashFile* .</p>
  
  <p>Also how to reference an array inside module based on dynamic module name?</p>
  
  <pre><code>@Array= @$Module1::Array_inside_module;
  </code></pre>
  
  <p>Is there anyway I can achieve this. Some sort of compiler directive?</p>