Tim wrote:
[ NOTE TO TIM: Your note in the roadmap shows both the scalar and hashref form of type info...in the interest of simplicity, I'd prefer a single form (hashrefs); do you have a strong opinion one way or the other ? ]
The goal is to keep bind_param cheap. But drivers can defer the cost of converting the scalar to a hash ref till the ParamTypes attribute is accessed.
Er, does that mean you prefer to support both scalar & hashref, or just hashref ?
My reasoning is from the POV of an application; if drivers can return either scalars *or* hashrefs, then the app has to be wired to handle both, vs. just handling hashrefs. I realize its not a big chunk of code, but it is an opportunity for confusion:
my $paramtypes = $sth->{ParamTypes}; print "Type of $_ is " . (ref $paramtypes->{$_} ? $paramtypes->{$_}{TYPE} : $paramtypes->{$_}) foreach (keys %$paramtypes);
vs.
my $paramtypes = $sth->{ParamTypes}; print "Type of $_ is $paramtypes->{$_}{TYPE}\n" foreach (keys %$paramtypes);
All seems fine. You can send the patch direct to me and I'll apply it. Or, if you give me your perl.org userid I'll give you commit rights[*]
Tim.
[*] I've decided to be more liberal with commit access than I have been in the past. I'll give commit access now to anyone with a track record of sane patches.
I'll just let you patch it for now.
- Dean