[Chicago-talk] Interpolation problem

Alan Mead amead2 at alanmead.org
Wed Sep 30 11:41:35 PDT 2015


On 9/30/2015 1:23 PM, richard at rushlogistics.com wrote:
> Wondering if anyone can lend a hand here. The set of queries below work when I just plug them directly into the MySQL console.  However, when I wrap them in perl they fail with SQL errors. 
>
>    my @rn;
>    my $q = "set @rn = 0"'; # set row number var for query below in order to be able to iterate as a hash in featadd.tt

Following on, the line above also needs single quotes or escaping and I
don't understand why there's a stray single quote between the closing
double-quote and the semi-colon; looks like a Perl syntax error to me. 

Also, you don't need to create a Perl list @rn to use an SQL variable.
You probably added it to make the Perl run (because without it, the
interpolation on the next line would cause a Perl syntax error).

-Alan

-- 

Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.

science + technology = better workers

+815.588.3846 (Office)
+267.334.4143 (Mobile)

http://www.alanmead.org

Announcing the Journal of Computerized Adaptive Testing (JCAT), a
peer-reviewed electronic journal designed to advance the science and
practice of computerized adaptive testing: http://www.iacat.org/jcat



More information about the Chicago-talk mailing list