in reply to Wierd Regex stuff..
That said cciulla's answer is right on the money, so I'll just offer a slightly expanded version. When you use the expression
Perl is replacing the value of the $search variable before matching it, so if $search contains "rlanda", the match expression becomes:/$search*/i
Now, the asterisk (*) means "zero or more of the previous expression". Unless the "previous expression" is a parenthesized one, it means "previous character". So you are looking for anything that contains "rland" followed by zero or more a's. Hence all the spurious matches./rlanda*/i
From the looks of it, you don't need the asterisk at all. You will do fine with just
/$search/i
--ZZamboni
|
|---|