<?xml version="1.0" encoding="windows-1252"?>
<node id="996642" title="Re: Devel::Declare type syntactic sugar for DBI select bind_col param" created="2012-10-01 08:37:42" updated="2012-10-01 08:37:42">
<type id="11">
note</type>
<author id="757127">
tobyink</author>
<data>
<field name="doctext">
&lt;p&gt;Just by subclassing DBI::db and using [mod://Perl::MethodCallWithBlock] I believe you could achieve:&lt;/p&gt;

&lt;code&gt;
$dbh-&gt;SELECT(
  [qw( name email )],
  from  =&gt; 'employees',
  where =&gt; { id =&gt; 42 },
) {
    printf("%s &lt;%s&gt;\n", $_-&gt;name, $_-&gt;email);
};

&lt;/code&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-757127"&gt;
&lt;small&gt;&lt;small&gt;
&lt;tt&gt;perl -E'sub Monkey::do{say$_,for@_,do{($monkey=&amp;#x5B;caller(0)]-&gt;&amp;#x5B;3])=~s{::}{ }and$monkey}}"Monkey say"-&gt;Monkey::do'
&lt;/tt&gt;&lt;/small&gt;&lt;/small&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
996497</field>
<field name="parent_node">
996497</field>
</data>
</node>
