I'm pretty sure that these are my compile notes (solaris 8, gcc-3.2) I'd expect them to work on Solaris 9 with little or no tweaking. Before you go to the trouble of reading through my meanderings, I'll mention that it sounds like the source of most of your trouble comes from using the perl install that comes with the OS. You'll want to build your own with the same compiler you'll be using on mod_perl. (perl has a notion of how it was built, and it tries to keep using that notion for future building.) So before ripping your machine apart, you might just want to try a custom perl install.
Before installing apache/mod_perl, I installed gcc-3.2 (Solaris package from sunfreeware,) libexpat ($prefix=/usr/local), and perl ($prefix=/usr/local/perl-$VERSION). If you try to use the perl that comes with Solaris, you will have all kinds of problems. Don't do that. After you've got perl installed in /usr/local/perl-$VERSION, make some symlinks:
/usr/local/perl@ -> perl-$VERSION
/usr/local/bin/perl@ -> ../perl/bin/perl
/usr/bin/perl@ -> /usr/local/bin/perl
You may want to consider that last symlink to be a little dangerous since you're messing around in OS territory, but it's what I do and it works fine for me. Note that if you do NOT replace /usr/bin/perl with a symlink to your new install, you will have to be very sure that when you're doing the apache build that you have /usr/local/bin in your PATH before /usr/bin
Lessee, I also had openssl and libmm installed in /usr/local (this is just for mod_ssl, though.)
# apache 1.3.31 with mod_ssl and mod_perl
export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib"
gzip -dc mod_perl-1.0-current.tar.gz | tar xf -
gzip -dc apache_1.3.31.tar.gz | tar xf -
gzip -dc mod_ssl-2.8.19-1.3.31.tar.gz | tar xf -
cd mod_ssl-2.8.19-1.3.31
./configure --with-apache=../apache_1.3.31 \
--with-ssl=SYSTEM --with-mm=SYSTEM \
--prefix=/usr/local/apache-1.3.31
cd ../mod_perl-1.29
perl Makefile.PL DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 \
SSL_BASE=/usr/local APACHE_PREFIX=/usr/local/apache-1.3.31 \
APACI_ARGS=--enable-suexec,--suexec-caller=httpd,--suexec-docroot=/home/htdocs,--server-uid=httpd,-
-
server-gid=httpd,--enable-module=most,--enable-shared=max
make
make test
make install
Next, I installed a prebuilt mysql from mysql.com in /usr/local. I wasn't too happy about that because I really wanted to build it from scratch with...uh...something that I don't remember off the top of my head, but it was a real bear to compile, so just went with the prebuilt package.
Last was the scoop install. I just ran the provided install script for my first time since it has the nifty CPAN thing. For subsequent scoop installs on that host, I did stuff manually, and that worked just fine.