System error

error:  Can't call method "prepare" on an undefined value at /home/www/bharath.com/htdocs/home/index.html line 260.
context: 
... 
256:  <%perl>
257:  sub sql_cmd($) {
258:  my $command = shift;
259:  my ($exec, @row, $rr);
260:  if ($exec = $dbh->prepare("$command")) {} else {my $str=$exec->errstr;&error("Could not prepare SQL statment - $str");}
261:  if ($exec->execute) {} else {my $str=$exec->errstr;&error("Could not execute statment - $str");}
262:  if ($command =~ /select+.*/ or $command =~ /SELECT+.*/) {
263:  while ($rr = $exec->fetchrow) {
264:  push (@row, $rr);
... 
code stack:  /home/www/bharath.com/htdocs/home/index.html:260
/home/www/bharath.com/htdocs/home/index.html:271
raw error






























Can't call method &quot;prepare&quot; on an undefined value at /home/www/bharath.com/htdocs/home/index.html line 260.


Trace begun at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Exceptions.pm line 131
HTML::Mason::Exceptions::rethrow_exception('Can\'t call method &quot;prepare&quot; on an undefined value at /home/www/bharath.com/htdocs/home/index.html line 260.^J') called at /home/www/bharath.com/htdocs/home/index.html line 260
HTML::Mason::Commands::sql_cmd('SELECT ID FROM MP_NEWS') called at /home/www/bharath.com/htdocs/home/index.html line 271
HTML::Mason::Commands::__ANON__ at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Component.pm line 134
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x86998e8)') called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 1057
eval {...}('HTML::Mason::Component::FileBased=HASH(0x86998e8)') called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 1056
HTML::Mason::Request::comp(undef, undef, undef) called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 331
eval {...}(undef, undef, undef) called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 331
eval {...}(undef, undef, undef) called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 290
HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0x897be1c)') called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 134
eval {...}('HTML::Mason::Request::ApacheHandler=HASH(0x897be1c)') called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 134
HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::ApacheHandler=HASH(0x897be1c)') called at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 792
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0x85b68d4)', 'Apache=SCALAR(0x895708c)') called at (eval 25) line 8
HTML::Mason::ApacheHandler::handler('HTML::Mason::ApacheHandler', 'Apache=SCALAR(0x895708c)') called at /dev/null line 0
eval {...}('HTML::Mason::ApacheHandler', 'Apache=SCALAR(0x895708c)') called at /dev/null line 0