title: Perl error : An error occurred while writing CGI reply
body: <p>When I add <code>use CGI::Session;</code> to my cgi file, I get this error:</p>
  
  <blockquote>
    <p>An error occurred while writing CGI reply</p>
  </blockquote>
  
  <p>If I comment that line its working fine.</p>
  
  <p>I am using cPanel to host my site. What is the reason for this error? Is this missing the <code>CGI::Session</code> module on the server of hosting service provider?</p>
  
  <p>How to fix this issue?</p>
  
  <p>Code:</p>
  
  <pre><code>#!/usr/local/bin/perl 
  use HTML::Template; 
  use DBI;
  use CGI;
  use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
  #use CGI::Session ;
  
  #send the obligatory Content-Type
  print "Content-Type: text/html\n\n"; 
  
  $user = '*******';
  $password = '********';
  
  #$session = CGI::Session-&gt;load();
  #$q = new CGI;
  
  $db_handle = DBI-&gt;connect ('DBI:mysql:database=amdvsfre_justclick',$user,$password) 
  or die "Couldn't connect to database: $DBI::errstr\n";
  
  #set the value of SQL query
  
  $sql_query = "SELECT t1.request_id, t1.request_message, t2.user_name, t2.user_city , COUNT(t3.request_id), t1.request_date, t1.request_time
  FROM requests t1 INNER JOIN users t2 ON t1.user_id = t2.user_id
  LEFT JOIN responses t3 ON t1.request_id = t3.request_id
  GROUP BY t1.request_id desc" ;
  
   ...
   ...
   passing the query result in template file, so that it can be displayed on the browser
  </code></pre>
  
  <p>If i uncommenting the #use CGI::Session ; then its giveing error. i need to import that file because i want to use session variable. how to fix the issue? </p>