in reply to Re^5: eval dilema
in thread eval dilema

This node was taken out by the NodeReaper on Jul 14, 2008 at 19:46 UTC

Replies are listed 'Best First'.
Re^7: eval dilema
by Corion (Patriarch) on Jul 14, 2008 at 11:37 UTC

    Ah - yes, indeed, you must already be using placeholders. But the reason to use placeholders is the same reason why you shouldn't be using the string form of eval anywhere. If a user supplies the right/wrong data, they can break out of your statement and do unexpected stuff.

    So, maybe the whole reason you're trying to do what you seem to want is that you're using the wrong data structure or you're using the wrong approach. But as you keep your goal to yourself, I can only point out split again, to convert a string to a list:

    my @keywords = split /,/, $str; #... prepare placeholder query for keywords ... $sth->execute(@keywords);