![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: string assignment.by cjcollier (Novice) |
on Jul 15, 2003 at 21:40 UTC ( #274593=note: print w/replies, xml ) | Need Help?? |
I highly reccomend using the DBI's ? substitution operator unless you know that $xvar, $yvar or $zvar don't contain any meta characters. But you should use them anyway, since that's what they're made for ;) A short explanation: When sending a query to the DBI, you can use the ? character and the arguments to C<exec()> to have the contents being substituted be checked for what may otherwise be considered metacharacters (characters that mean something other than themselves, eg ' (begin/end string), % (mysql's glob character), & (the conjunction character), etc.). Here's an example: (this code not tested, and yes, I know the same thing could be acheived with less code.)
In Section
Seekers of Perl Wisdom
|
|