try add these options when new the DBI object:

          PrintError => 0,
          RaiseError => 0,


2011/4/15 Agnello George <agnello.dso...@gmail.com>:
> Hi All
>
> In my code i am trying to connect to a db if it fails it should return
> 0 ,  this a web based script and it throws me internal server error
> and the apache logs gives me Premature end of script headers:
> syncscript.pl   , But if i am able to connect to the remote host  then
> my code works fine
>
>
> print "Content-type: text/html\n\n";
> :
> :
> :
> sub some_sub {
> eval{
> alarm(5);
>  $DBH_local = DBI->connect("DBI:mysql::192.168.1.26", "all_user",
> "all_passwd")   ;
>  alarm(0);
>  } ;
>  if ($@){
>  return 0;
> }
>
> }
>
>
>
>
>
> i even tried the following :
>
>
> sub some_sub {
>  $DBH_local = DBI->connect("DBI:mysql::192.168.1.26", "all_user",
> "all_passwd") || return 0  ;
>
>  } ;
>
> }
>
>
> but this too doesn't work . gives me the same error "Internal server error "
>
> Please help me with this thanks
>
> --
> Regards
> Agnello D'souza
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to