in reply to Review and Suggestions - My First Module
you will get errors related to your returning of undef at the first location where you try to use the value in stead of a nice Carp saying something to the effect of "Hey, I don't know what a 'foo' database is." which will be reported for the line where the mistake actually occurs.my $dbh = My::DB->new({server => 'foo', db => 'oops.db'})
if ($data->{server} eq 'pg') { ... } elsif ($data->{server} eq 'sqlite') { ... } else { Carp::croak "Oops, you tried to access a '$data->{server}' type data +base, but I have no idea what that is"; }
|
---|