System error

error:  Can't call method "prepare" on an undefined value at /srv/www/kspei/comp/news line 13.
context: 
... 
9:  . "where active='1' && (end='0000-00-00' || end>CURDATE()) "
10:  . "order by article_date desc";
11: 
12:  $string.=" limit $limit" if ($limit);
13:  if ($q=$dbh->prepare($string) and $q->execute() and $q->rows()) {
14:  my @stories;
15: 
16:  #$m->print("<!-- " . $q->rows() . " stories found -->\n");
17:  while (my $row = $q->fetchrow_hashref) {
... 
code stack:  /srv/www/kspei/comp/news:13
/srv/www/kspei/comp/html/index.html:19
/srv/www/kspei/comp/autohandler:7
raw error






























Can't call method "prepare" on an undefined value at /srv/www/kspei/comp/news line 13.


Trace begun at /usr/share/perl5/HTML/Mason/Exceptions.pm line 129
HTML::Mason::Exceptions::rethrow_exception('Can\'t call method "prepare" on an undefined value at /srv/www/kspei/comp/news line 13.^J') called at /srv/www/kspei/comp/news line 13
HTML::Mason::Commands::__ANON__('limit', 5) called at /usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fdb059e0d88)', 'limit', 5) called at /usr/share/perl5/HTML/Mason/Request.pm line 1284
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 1274
HTML::Mason::Request::comp(undef, undef, 'limit', 5) called at /srv/www/kspei/comp/html/index.html line 19
HTML::Mason::Commands::__ANON__ at /usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fdb059383f8)') called at /usr/share/perl5/HTML/Mason/Request.pm line 1279
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 1274
HTML::Mason::Request::comp(undef, undef, undef) called at /usr/share/perl5/HTML/Mason/Request.pm line 943
HTML::Mason::Request::call_next('HTML::Mason::Request::ApacheHandler=HASH(0x7fdb05aeccd0)') called at /srv/www/kspei/comp/autohandler line 7
HTML::Mason::Commands::__ANON__ at /usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fdb058df6a8)') called at /usr/share/perl5/HTML/Mason/Request.pm line 1279
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 1274
HTML::Mason::Request::comp(undef, undef, undef) called at /usr/share/perl5/HTML/Mason/Request.pm line 473
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 473
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 425
HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0x7fdb05aeccd0)') called at /usr/share/perl5/HTML/Mason/ApacheHandler.pm line 168
HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::ApacheHandler=HASH(0x7fdb05aeccd0)') called at /usr/share/perl5/HTML/Mason/ApacheHandler.pm line 825
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0x7fdb058921d8)', 'Apache2::RequestRec=SCALAR(0x7fdb059d10b8)') called at (eval 36) line 8
HTML::Mason::ApacheHandler::handler('HTML::Mason::ApacheHandler', 'Apache2::RequestRec=SCALAR(0x7fdb059d10b8)') called at -e line 0
eval {...} at -e line 0