The script didn't work before the installation but it was just saying syntax error. This is my first attempt at perlscript rather than perl, and I was hoping win32::asp would be gentler on me
the script looks like this btw (it's building a decent query string for a site search.)
thanks, andyuse WIN32::ASP; $sqlStatement = ""; If (GetFormValue('SearchText') ne "") { my $conj; my $query=GetFormValue('SearchText'); $query=~s/([\(\)])/ $1 /g; $query=~tr/A-Z/a-z/; $query=~tr/a-z0-9() //cd; $query=~tr/ / /s; $query=~s/^ //; $query=~s/ $//; foreach $word (split(/ /,$query)) { if ($word=~/^(and|or|not|\(|\))$/) { $word=~tr/a-z/A-Z/; $sqlStatement.=" AND" if (($word eq "NOT") && ($preWord!=~ +/^and|or$/i)); $sqlStatement.=" $word"; $conj=$word; } else { $sqlStatement.=" AND" unless ($conj || !$sqlStatement); $sqlStatement.=" keywords LIKE '%$word%'"; $conj=""; } $prevWord=$word; } } $sqlStatement="WHERE $sqlStatement" if $sqlStatement; $Response->Redirect("search2.asp?searchtext=$sqlStatement"); %>
In reply to Re: Re: upgrading activeperl
by theandygrant
in thread upgrading activeperl
by theandygrant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |