in reply to DBI, quoting and like - SQLite

The question I have here is how are you setting the var to include the quotes: i.e. $var = '\'final\''; or just $var = 'final'?

the latter won't work if the entry starts with a ' and you're doing a '$string%' match.

I recommend you use the sql escape of quoting a quote with a quote so before you do a match run $var =~ s/\'/\'\'/g; first Good luck

Replies are listed 'Best First'.
Re: Re: DBI, quoting and like - SQLite
by castaway (Parson) on Feb 25, 2003 at 10:06 UTC
    I'm matching against text typed in by the user.. It's read and passed on like this:
    *imagine IO::Socket, IO::Select code here* .. $line = <STDIN>; chomp($line); parse_command($line); .. sub parse_command { my ($data) = @_; .. if($data =~ /^tell (.+?)\@(.+?) (.+)$/) { @args = ($2, 'tell', $1, $3); } .. if(@args) { $i2->send(@args); } } .. sub send { my ($me, $dest, $request, @params) = @_; .. if($dest ne 'all' && !defined($testmud = $me->getMudName($dest))) ... }
    Does that answer the question, more or less? ;)

    C.