Sorry, really not was must exact,
DBI version 1.37
lines 487 - 540
# --- The DBI->connect Front Door methods
sub connect_cached {
# XXX we expect Apache::DBI users to still call connect()
my ($class, $dsn, $user, $pass, $attr) = @_;
($attr ||= {})->{dbi_connect_method} = 'connect_cached';
return $class->connect($dsn, $user, $pass, $attr);
}
sub connect {
my $class = shift;
my ($dsn, $user, $pass, $attr, $old_driver) = my @orig_args = @_;
my $driver;
if ($attr and !ref($attr)) { # switch $old_driver<->$attr if called in old
style
Carp::carp("DBI->connect using 'old-style' syntax is deprecated and
will be an error in future versions");
($old_driver, $attr) = ($attr, $old_driver);
}
my $connect_meth = $attr->{dbi_connect_method};
$connect_meth ||= $DBI::connect_via; # fallback to default
$dsn ||= $ENV{DBI_DSN} || $ENV{DBI_DBNAME} || '' unless $old_driver;
if ($DBI::dbi_debug) {
local $^W = 0;
pop @_ if $connect_meth ne 'connect';
my @args = @_; $args[2] = '****'; # hide password
DBI->trace_msg(" -> $class->$connect_meth(".join(",",@args).")\n");
}
Carp::croak('Usage: $class->connect([$dsn [,$user [,$passwd [,\%attr]]]])')
if (ref $old_driver or ($attr and not ref $attr) or ref $pass);
# extract dbi:driver prefix from $dsn into $1
$dsn =~ s/^dbi:(\w*?)(?:\((.*?)\))?://i
or '' =~ /()/; # ensure $1 etc are empty if match
fails
my $driver_attrib_spec = $2 || '';
# Set $driver. Old style driver, if specified, overrides new dsn style.
$driver = $old_driver || $1 || $ENV{DBI_DRIVER}
or Carp::croak("Can't connect(@_), no database driver specified "
."and DBI_DSN env var not set");
if ($ENV{DBI_AUTOPROXY} && $driver ne 'Proxy' && $driver ne 'Sponge' &&
$driver ne 'Switch') {
my $proxy = 'Proxy';
if ($ENV{DBI_AUTOPROXY} =~ s/^dbi:(\w*?)(?:\((.*?)\))?://i) {
$proxy = $1;
my $attr_spec = $2 || '';
$driver_attrib_spec = ($driver_attrib_spec) ?
"$driver_attrib_spec,$attr_spec" : $attr_spec;
}
$dsn = "$ENV{DBI_AUTOPROXY};dsn=dbi:$driver:$dsn";
$driver = $proxy;
DBI->trace_msg(" DBI_AUTOPROXY:
dbi:$driver($driver_attrib_spec):$dsn\n");
}
On Tuesday 15 July 2003 20:02, Ron Savage wrote:
> Hi Jorge
>
> >Hi, I have a problem with integration of
> >apache+mod_perl+mod_auth_pgsql. The
> >error is the follow:
> >[Tue Jul 15 13:06:47 2003] [error] Can't use string ("") as a HASH
> >ref
> >while"strict refs" in use at /usr/lib/perl5/site_perl/5.8.0/i386-
> >linux/DBI.pm
> >line 506
>
> I would have helped if you had shown us lines 490 .. 520 of that
> version of that module.
>
> And, which version?
>
> Either way, it's a bug in your code, I'd say. You have - I suspect -
> passed to DBI a value outside it's acceptable range of parameters and
> their values.