in reply to the god awful =~

/i|"$request"/ matches on either
i or "$request" including the quotation marks

it looks to me like you are trying to make it case insensitive, in this case your regexp should simply be /$request/i