in reply to Re: Re: Passing data from one perl script to another.
in thread Problem constructing an SQL query with LIKE clauses

Mea culpa for being obscure. By "left as an exercise" I meant that like_arg() was a piece that you would need to supply yourself.

The idea is to form the wildcard string at runtime. It will look something like the following (from memory):

sub like_arg { my ($prewild, $string, $postwild) = @_; return "%" if $string eq ""; return "%" . $string . "%" if $prewild and $postwild; return "%" . $string if $prewild; return $string . "%" if $postwild; ""; }