Hi all-

        I'm really having a problem I hope I might be able to get some help
with.  I'm using Apache 1.3.14, mod_perl 1.24, DBI 1.14, MySQL Modules 1.2215,
Perl 5.6.0, and MySQL 3.22.32.  (I think that's all that's relevant)

In my httpd.conf I have the following:

#------------------------------
<Location /testing>
   SetHandler perl-script
   PerlHandler Testing
</Location>
#------------------------------

And I have a script called Testing.pm that looks like this:

#------------------------------
package Testing;
 
use strict;
use DBI;
 
sub handler {
  print "Content-type:\n\n<html><head><title>test</title></head><body><pre>";
  print "Getting Data Sources...\n";
 
  my @drivers = DBI->data_sources('mysql');
 
  print "Done Getting Data Sources...\n";
  foreach my $foo (@drivers) {
    print "DataSource-> $foo \n";
  }
  print "Getting Data Sources Complete...\n";
  print "</pre></body></html>\n";
}
 
1;
#------------------------------

Consistantly, I get a SegFault when going to /testing.  Using strace, I see
that it actually calls DBI and gets the valid results.  Everything looks good
to me, but it dies after closing the FD.

The funny thing is, if I modify the Testing.pm module to be test.pl, it works.

#------------------------------
#package Testing;

use strict;
use DBI;
 
#sub handler {
  print "Content-type:\n\n<html><head><title>test</title></head><body><pre>";
  print "Getting Data Sources...\n";
 
  my @drivers = DBI->data_sources('mysql');
 
  print "Done Getting Data Sources...\n";
  foreach my $foo (@drivers) {
    print "DataSource-> $foo \n";
  }
  print "Getting Data Sources Complete...\n";
  print "</pre></body></html>\n";
#}

#1;
#------------------------------

Anybody have any ideas?  I've tried everything I can come up with.

        Thanks,
        -Eric.


Reply via email to