Darren Duncan wrote:
Just look at the SYNOPSIS documentation. As near as I can tell, most functionality is method-only, with a few miscellaneous extras being tied only.
Another way to look at it is that DBI is made up of handles which have the very important property that the behaviour of a handle's methods can be modified by setting its attributes independent of other sorts of parameters passed to the method. It is not a "miscellaneous extra" that \%attrs is a parameter to virtually every method in the DBI or that passing \%attrs does a fundamentally different thing than passing $dsn, or $sql or $value. This important feature will be expanded in v2.x as things like $dbh->connect() and $sth->prepare() and per-statement-handle -attributes are introduced.
If you change $dbh->{RaiseError}=1 to $dbh->raise_error(1), what is it you are proposing for DBI->connect( ..., {RaiseError=>1, PrintError=0} )? Handle attributes are a series of name/value pairs. What more natural way is there in Perl to deal with name/value pairs than a hash? And since hashes can be tied to provide privacy and encapsulation, what rule does it break to use them other than the rule that objects have round things at the end of their arrows rather than squiggly things?
-- Jeff