in reply to Perl DBI / Variable Question

While not inevitably necessary, using '%${mainsearch}%' instead of '%$mainsearch%' will make your code more readable in this special context. Otherwise, it looks at first glance as if $mainsearch was a hash reference being dereferenced.

Otherwise, what geekphilosopher said.

Replies are listed 'Best First'.
Re^2: Perl DBI / Variable Question
by Trihedralguy (Pilgrim) on Jan 25, 2007 at 20:29 UTC
    If I run the SQL statement without the perl formatting (duh) on the database but replace '$mainsearch' with something like CAT...the statement DOES work correctly, and grabs rows with a value of 'CAT" from the database. But the real problem comes when I change it back and in perl when the user runs the code...It "stops" (not HAULTS) but just doesnt finish the rest of the 'or' statements. (if that makes sense) So basically, in my terms $mainsearch is loosing its value cause its no longer checking the condition on att_data and etc... I'm still fairly clueless to what I've done wrong. In response to using % on read_input, apparently the snippit of code I got to read input from the previous page (form) is suppost to be that way. *shrugs* It works :)