http://www.perlmonks.org?node_id=241049


in reply to Mysql module

I believe LEFT() ought to take two parameters; one being a string to extract characters from and two being the number of characters to extract. Maybe you should try something like

my $l = length($var); my $query = "SELECT field1,field2 FROM my_table WHERE LEFT(field3,$l) += '$var'";
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';