title: Perl internal server error when using Email::valid
body: <p>I noticed I'm getting <em>Internal server error 500</em> when i try to use Email::Valid in my CGI script. I'm a newbie in this, so i'm not able to understand what the problem may be. I'm trying to write a simple form validator using Email::Valid to validate email addresses, but when I try to put the line</p>
  
  <pre><code>use Email::Valid;
  </code></pre>
  
  <p>it gives me the error. Here's my complete code:</p>
  
  <pre><code>#!C:\xampp\perl\bin\perl.exe
  
  use Email::Valid;
  use CGI;
  
  
  my $query = new CGI;
  print $query-&gt;header ( );
  
  my $nome = $query-&gt;param("Nome");
  my $email_address = $query-&gt;param("Email");
  my $website = $query-&gt;param("Website");
  my $comments = $query-&gt;param("Messaggio");
  
  $nome = filter ( $nome );
  unless( Email::Valid-&gt;address($email_address) ) {
      $email_address = "Invalid email address";
  }
  $website = filter ( $website );
  $comments = filter ( $comments );
  
  
  print "Nome: $nome&lt;br&gt;";
  print "Email: $email_address&lt;br&gt;";
  print "Sito: $website&lt;br&gt;";
  print "$comments&lt;br&gt;";
  
  print &lt;&lt;END_HTML;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;Thanks for filling in our form!&lt;/body&gt;
  &lt;/html&gt;
  END_HTML
  
  
  sub filter
  {
    my $field = shift;
    $field =~ s/From://gi;
    $field =~ s/To://gi;
    $field =~ s/BCC://gi;
    $field =~ s/CC://gi;
    $field =~ s/Subject://gi;
    $field =~ s/Content-Type://gi;
    $field =~ s/[\0\n\r\|\!\/\&lt;\&gt;\^\$\%\*\&amp;]+/ /g;
    return $field;
  }
  </code></pre>
  
  <p>When using this code without the Email::Valid, it works fine!</p>
  
  <pre><code>#!C:\xampp\perl\bin\perl.exe
  
  use CGI;
  
  
  my $query = new CGI;
  print $query-&gt;header ( );
  
  my $nome = $query-&gt;param("Nome");
  my $email_address = $query-&gt;param("Email");
  my $website = $query-&gt;param("Website");
  my $comments = $query-&gt;param("Messaggio");
  
  $nome = filter ( $nome );
  $email_address = filter ( $email_address );
  $website = filter ( $website );
  $comments = filter ( $comments );
  
  
  print "Nome: $nome&lt;br&gt;";
  print "Email: $email_address&lt;br&gt;";
  print "Sito: $website&lt;br&gt;";
  print "$comments&lt;br&gt;";
  
  print &lt;&lt;END_HTML;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;Thanks for filling in our form!&lt;/body&gt;
  &lt;/html&gt;
  END_HTML
  
  
  sub filter
  {
    my $field = shift;
    $field =~ s/From://gi;
    $field =~ s/To://gi;
    $field =~ s/BCC://gi;
    $field =~ s/CC://gi;
    $field =~ s/Subject://gi;
    $field =~ s/Content-Type://gi;
    $field =~ s/[\0\n\r\|\!\/\&lt;\&gt;\^\$\%\*\&amp;]+/ /g;
    return $field;
  }
  </code></pre>