I've intermixed DBI.pm (connecting to DB2) and CGI.pm a lot, so I'm pretty sure there is no name conflict between the two. One problem, I've run into frequently, however, is that the configuration of the account when running from the web server is sometimes deliberately limited. One way that I debug this is to print out the runtime environment in the CGI.pm program and make sure that the right environment is there. The following line of code prints the environment.
map ( printf ("%s: %s\n", $_, $ENV{$_)), sort keys %ENV ); Try putting that before the attempt to connect in the CGI.pm program.