> 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.

Er, this is not exactly virgin territory here.  Virtually every common
post-wild-west-early-days (sorry DBI, CGI.pm ;) Perl 5 module uses
some kind of simple "named attribute" interface.  Look at DateTime for
just one recent example.  This is also the direction of Perl 6
interfaces.

> What more natural way is there in Perl to deal with name/value pairs than a
> hash?

Boldly speaking for the Entire Perl Community (ha!) interfaces like this:

    $x->foo(..., {...})

are generally considered icky.  Who here doesn't cringe when they
see those curly braces in a newly downloaded CPAN module's POD?  It's an
annoying, problem-prone way to tack "extensibility" onto an API that has
otherwise painted itself into a corner with too many positional
params (*cough*bind_columns(undef, ...))

> 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?

There are better ways to implement encapsulation and extensibility
than tied hashes.  They're called "objects" and "methods" :)  If ties were
sufficient and "just as good", then Perl 5 (and 6) would have no need for
proper objects and methods.

-John


Reply via email to